Commit c184655c1acde62b7ce7711e9815f5c956258374
1 parent
9c97e126
fixed bugs in AABB wireframe rendering
Showing
1 changed file
with
20 additions
and
3 deletions
Show diff stats
stim/visualization/gl_aabb.h
... | ... | @@ -19,19 +19,36 @@ public: |
19 | 19 | |
20 | 20 | |
21 | 21 | /// Specifies vertices of the bounding box using CW winding. Use GL_LINE_LOOP for wireframe or GL_QUADS for a solid. |
22 | - void glPointsCW(){ | |
22 | + void glWire(){ | |
23 | 23 | |
24 | - //front plane (in A[2]) | |
24 | + //front plane (in A[2]) | |
25 | + glBegin(GL_LINE_LOOP); | |
25 | 26 | glVertex3f(A[0], A[1], A[2]); |
26 | 27 | glVertex3f(A[0], B[1], A[2]); |
27 | 28 | glVertex3f(B[0], B[1], A[2]); |
28 | 29 | glVertex3f(B[0], A[1], A[2]); |
30 | + glEnd(); | |
29 | 31 | |
30 | - //back plane (in B[2]) | |
32 | + //back plane (in B[2]) | |
33 | + glBegin(GL_LINE_LOOP); | |
31 | 34 | glVertex3f(B[0], B[1], B[2]); |
32 | 35 | glVertex3f(A[0], B[1], B[2]); |
33 | 36 | glVertex3f(A[0], A[1], B[2]); |
34 | 37 | glVertex3f(B[0], A[1], B[2]); |
38 | + glEnd(); | |
39 | + | |
40 | + //fill out the rest of the lines to connect the two faces | |
41 | + glBegin(GL_LINES); | |
42 | + glVertex3f(A[0], B[1], A[2]); | |
43 | + glVertex3f(A[0], B[1], B[2]); | |
44 | + glVertex3f(B[0], B[1], B[2]); | |
45 | + glVertex3f(B[0], B[1], A[2]); | |
46 | + glVertex3f(B[0], A[1], A[2]); | |
47 | + glVertex3f(B[0], A[1], B[2]); | |
48 | + glVertex3f(A[0], A[1], B[2]); | |
49 | + glVertex3f(A[0], A[1], A[2]); | |
50 | + glEnd(); | |
51 | + | |
35 | 52 | } |
36 | 53 | |
37 | 54 | ... | ... |