aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric J <49599659+ProfJski@users.noreply.github.com>2019-11-21 18:30:19 -0500
committerRay <raysan5@gmail.com>2019-11-22 00:30:19 +0100
commit5d27c1e6c9d03dabafd4626e1e33643fe9dd8bb1 (patch)
treebe114d4d75c35ac755a746f59581e7502b9dab23
parentd2882a68fe2e6f458ed756dc90c4474df5769c50 (diff)
downloadraylib-5d27c1e6c9d03dabafd4626e1e33643fe9dd8bb1.tar.gz
raylib-5d27c1e6c9d03dabafd4626e1e33643fe9dd8bb1.zip
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.
-rw-r--r--src/models.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c
index f70dd409..61d84afb 100644
--- a/src/models.c
+++ b/src/models.c
@@ -110,6 +110,22 @@ void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color)
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
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color)
{