Add DrawPoint3D() function to models.c (#1019)
Uses fewer vertexes than using DrawCube() or DrawSphere() for points. The small line is on analogy to the code for DrawPoint() in shapes.c.
This commit is contained in:
parent
d2882a68fe
commit
5d27c1e6c9
1 changed files with 16 additions and 0 deletions
16
src/models.c
16
src/models.c
|
@ -110,6 +110,22 @@ void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color)
|
||||||
rlEnd();
|
rlEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Draw a point in 3D space--actually a small line.
|
||||||
|
void DrawPoint3D(Vector3 pos, Color color) {
|
||||||
|
|
||||||
|
if (rlCheckBufferLimit(8)) rlglDraw();
|
||||||
|
rlPushMatrix();
|
||||||
|
rlTranslatef(pos.x,pos.y,pos.z);
|
||||||
|
rlBegin(RL_LINES);
|
||||||
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
rlVertex3f(0.0,0.0,0.0);
|
||||||
|
rlVertex3f(0.0,0.0,0.1);
|
||||||
|
rlEnd();
|
||||||
|
rlPopMatrix();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Draw a circle in 3D world space
|
// Draw a circle in 3D world space
|
||||||
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color)
|
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue