aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2014-11-25 09:41:12 +0100
committerWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2014-11-25 09:41:12 +0100
commitff5c0c58953aa679b2b794906428f8a7cd2b2696 (patch)
tree8a88d7e23c312fc3f29b76e842db1bd0a8f650dc
parentb62b7bf28ec0069e6f460fa0f07b64a0dba72557 (diff)
downloadcodesamples-ff5c0c58953aa679b2b794906428f8a7cd2b2696.tar.gz
codesamples-ff5c0c58953aa679b2b794906428f8a7cd2b2696.tar.bz2
solid arrowheads in frustum
-rw-r--r--samples/OpenGL/frustum/frustum.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/samples/OpenGL/frustum/frustum.c b/samples/OpenGL/frustum/frustum.c
index 2728cee..5e70382 100644
--- a/samples/OpenGL/frustum/frustum.c
+++ b/samples/OpenGL/frustum/frustum.c
@@ -168,10 +168,12 @@ void draw_arrow(
by + (-0.866*d[1] - 0.5*b[1])*bh,
bz + (-0.866*d[2] - 0.5*b[2])*bh }
};
- GLushort const idx[][2] = {
+ GLushort const idx_line[][2] = {
{0, 1},
- {0, 2}, {0, 3},
- {1, 4}, {1, 5}
+ };
+ GLushort const idx_heads[][3] = {
+ {0, 2, 3},
+ {1, 4, 5}
};
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
@@ -180,7 +182,8 @@ void draw_arrow(
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, pos);
- glDrawElements(GL_LINES, 2*5, GL_UNSIGNED_SHORT, idx);
+ glDrawElements(GL_LINES, 2, GL_UNSIGNED_SHORT, idx_line);
+ glDrawElements(GL_TRIANGLES, 2*3, GL_UNSIGNED_SHORT, idx_heads);
glDisableClientState(GL_VERTEX_ARRAY);
if(annotation) {