diff options
Diffstat (limited to 'Smoke/renderer_gl.c')
-rw-r--r-- | Smoke/renderer_gl.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/Smoke/renderer_gl.c b/Smoke/renderer_gl.c index eccf8b1..e0df386 100644 --- a/Smoke/renderer_gl.c +++ b/Smoke/renderer_gl.c @@ -764,7 +764,28 @@ static void render_streamlines(void) struct point p; struct fftw_real_xy *frame_history; fftw_real cell_x, cell_y; - float scale = 10.0f; + float scale = 10.0f;
+ GLuint lid = glGenLists(1);
+ GLUquadricObj *qobj = gluNewQuadric();
+
+ gluQuadricDrawStyle(qobj, GLU_FILL);
+ gluQuadricNormals(qobj, GLU_FLAT);
+ gluQuadricOrientation(qobj, GLU_OUTSIDE);
+
+ glDisable(GL_BLEND);
+
+ if (streamlines_get_sort() == STREAMLINES_SORT_TUBES)
+ {
+ glNewList(lid, GL_COMPILE);
+ gluCylinder(qobj, 6.0, 6.0, 16.0, 8, 8);
+ glEndList(); + } + else if (streamlines_get_sort() == STREAMLINES_SORT_SPHERES)
+ {
+ glNewList(lid, GL_COMPILE);
+ gluSphere(qobj, 10.0f, 8, 8);
+ glEndList(); + } glLineWidth(2.5f); @@ -775,7 +796,9 @@ static void render_streamlines(void) p = get_seedpoint(i); p.y = winHeight - p.y; - glBegin(GL_LINE_STRIP); + if (streamlines_get_sort() == STREAMLINES_SORT_LINES) { + glBegin(GL_LINE_STRIP); + } for (j = 0; j < HISTORY_SIZE; j++) { @@ -795,9 +818,20 @@ static void render_streamlines(void) p.x += vx * cell_x * scale; p.y += vy * cell_y * scale; - glVertex3f(p.x, p.y, j * cell_x); + if (streamlines_get_sort() == STREAMLINES_SORT_LINES) { + glVertex3f(p.x, p.y, j * cell_x); + } + else { + glPushMatrix();
+ glTranslatef(p.x, p.y, j * cell_x);
+ glCallList(lid);
+ glPopMatrix(); + } + } + + if (streamlines_get_sort() == STREAMLINES_SORT_LINES) { + glEnd(); } - glEnd(); } glLineWidth(1.0f); } |