diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-09 16:22:34 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-09 16:22:34 (GMT) |
commit | 4b45e834c8a243d299f7b09960dc43db58cb7910 (patch) | |
tree | 81f58e6af8c70b1695ff374d085cacd15edd0d13 /Smoke/renderer_gl.c | |
parent | 19104903490d2c67f9b385804a7f89df8f6fc48c (diff) | |
download | 2iv35-4b45e834c8a243d299f7b09960dc43db58cb7910.zip 2iv35-4b45e834c8a243d299f7b09960dc43db58cb7910.tar.gz 2iv35-4b45e834c8a243d299f7b09960dc43db58cb7910.tar.bz2 |
fix frame history!
Diffstat (limited to 'Smoke/renderer_gl.c')
-rw-r--r-- | Smoke/renderer_gl.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/Smoke/renderer_gl.c b/Smoke/renderer_gl.c index 0ce22e7..96b9faa 100644 --- a/Smoke/renderer_gl.c +++ b/Smoke/renderer_gl.c @@ -322,6 +322,7 @@ void render_smoke(void) frame = smoke_get_frame(); height = heightplots_get_frame(); normal = normals_get_frame(); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); for (j = 0; j < DIM - 1; j++) //draw smoke @@ -711,7 +712,7 @@ static void render_streamlines(void) while (j < DIM) { - frame_history = frame_hist[j]; + // frame_history = frame_hist[j]; cell_x = (fftw_real)winWidth / (fftw_real)(DIM + 1); // Grid cell width cell_y = (fftw_real)winHeight / (fftw_real)(DIM + 1); // Grid cell heigh @@ -727,6 +728,11 @@ static void render_streamlines(void) } } +static int hisdex = 0; + +void set_hisdex(int arg) { + hisdex = arg; +} static void render_flowvis(void) { @@ -734,12 +740,15 @@ static void render_flowvis(void) double px,py; fftw_real wn, hn; struct color4f color; + fftw_real *history; DIM = fluids_get_dim(); wn = (fftw_real)winWidth / (fftw_real)(DIM + 1); // Grid cell width hn = (fftw_real)winHeight / (fftw_real)(DIM + 1); // Grid cell height + history = streamlines_get_history(hisdex); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); for (j = 0; j < DIM - 1; j++) //draw smoke @@ -751,38 +760,33 @@ static void render_flowvis(void) py = hn + (fftw_real)j * hn; idx = (j * DIM) + i; - color = flowvis_get_color(get_dataset(idx)); + color = flowvis_get_color(history[idx]); glColor4f(color.r, color.g, color.b, color.a); - glNormal3f(normal_array[idx].x, normal_array[idx].y, normal_array[idx].z); - glVertex3f(px, py, height_array[idx]); // vertex 1 + glVertex2f(px, py); // vertex 1 for (i = 0; i < DIM - 1; i++) { px = wn + (fftw_real)i * wn; py = hn + (fftw_real)(j + 1) * hn; idx = ((j + 1) * DIM) + i; - get_dataset(idx); - color = flowvis_get_color(get_dataset(idx)); + color = flowvis_get_color(history[idx]); glColor4f(color.r, color.g, color.b, color.a); - glNormal3f(normal_array[idx].x, normal_array[idx].y, normal_array[idx].z); - glVertex3f(px, py, height_array[idx]); // vertex 2 + glVertex2f(px, py); // vertex 2 px = wn + (fftw_real)(i + 1) * wn; py = hn + (fftw_real)j * hn; idx = (j * DIM) + (i + 1); - color = flowvis_get_color(get_dataset(idx)); + color = flowvis_get_color(history[idx]); glColor4f(color.r, color.g, color.b, color.a); - glNormal3f(normal_array[idx].x, normal_array[idx].y, normal_array[idx].z); - glVertex3f(px, py, height_array[idx]); // vertex 3 + glVertex2f(px, py); // vertex 3 } px = wn + (fftw_real)(DIM - 1) * wn; py = hn + (fftw_real)(j + 1) * hn; idx = ((j + 1) * DIM) + (DIM - 1); - color = flowvis_get_color(get_dataset(idx)); + color = flowvis_get_color(history[idx]); glColor4f(color.r, color.g, color.b, color.a); - glNormal3f(normal_array[idx].x, normal_array[idx].y, normal_array[idx].z); - glVertex3f(px, py, height_array[idx]); // vertex 4 + glVertex2f(px, py); // vertex 4 glEnd(); } |