From ff5c0c58953aa679b2b794906428f8a7cd2b2696 Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Tue, 25 Nov 2014 09:41:12 +0100 Subject: solid arrowheads in frustum --- samples/OpenGL/frustum/frustum.c | 11 +++++++---- 1 file 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) { -- cgit v1.2.3