From c184655c1acde62b7ce7711e9815f5c956258374 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 8 Feb 2016 13:23:56 -0600 Subject: [PATCH] fixed bugs in AABB wireframe rendering --- stim/visualization/gl_aabb.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/stim/visualization/gl_aabb.h b/stim/visualization/gl_aabb.h index e8c5a45..b5b2415 100644 --- a/stim/visualization/gl_aabb.h +++ b/stim/visualization/gl_aabb.h @@ -19,19 +19,36 @@ public: /// Specifies vertices of the bounding box using CW winding. Use GL_LINE_LOOP for wireframe or GL_QUADS for a solid. - void glPointsCW(){ + void glWire(){ - //front plane (in A[2]) + //front plane (in A[2]) + glBegin(GL_LINE_LOOP); glVertex3f(A[0], A[1], A[2]); glVertex3f(A[0], B[1], A[2]); glVertex3f(B[0], B[1], A[2]); glVertex3f(B[0], A[1], A[2]); + glEnd(); - //back plane (in B[2]) + //back plane (in B[2]) + glBegin(GL_LINE_LOOP); glVertex3f(B[0], B[1], B[2]); glVertex3f(A[0], B[1], B[2]); glVertex3f(A[0], A[1], B[2]); glVertex3f(B[0], A[1], B[2]); + glEnd(); + + //fill out the rest of the lines to connect the two faces + glBegin(GL_LINES); + glVertex3f(A[0], B[1], A[2]); + glVertex3f(A[0], B[1], B[2]); + glVertex3f(B[0], B[1], B[2]); + glVertex3f(B[0], B[1], A[2]); + glVertex3f(B[0], A[1], A[2]); + glVertex3f(B[0], A[1], B[2]); + glVertex3f(A[0], A[1], B[2]); + glVertex3f(A[0], A[1], A[2]); + glEnd(); + } -- libgit2 0.21.4