diff options
author | Wilrik de Loose <wilrik@wilrik.nl> | 2008-01-10 20:59:50 (GMT) |
---|---|---|
committer | Wilrik de Loose <wilrik@wilrik.nl> | 2008-01-10 20:59:50 (GMT) |
commit | dcab21f30e9c451bfc2b7e65d90323b5e11a8612 (patch) | |
tree | 07ead18381e62c1ef7295252126410d73ac8164a /Smoke/renderer_gl.c | |
parent | a003a02f8ae4f5bc14cbed9249b0fbfefdd2fd07 (diff) | |
download | 2iv35-dcab21f30e9c451bfc2b7e65d90323b5e11a8612.zip 2iv35-dcab21f30e9c451bfc2b7e65d90323b5e11a8612.tar.gz 2iv35-dcab21f30e9c451bfc2b7e65d90323b5e11a8612.tar.bz2 |
normal vectors correct
Diffstat (limited to 'Smoke/renderer_gl.c')
-rw-r--r-- | Smoke/renderer_gl.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Smoke/renderer_gl.c b/Smoke/renderer_gl.c index 8cc2095..ac10bf7 100644 --- a/Smoke/renderer_gl.c +++ b/Smoke/renderer_gl.c @@ -296,12 +296,12 @@ static void render_normals(void) idx = (j * DIM) + i; px = wn + (fftw_real)i * wn; py = hn + (fftw_real)(j + 1) * hn; - pz = height[idx] *height_multiplier; + pz = height[idx] * 16; glVertex3f(px, py, pz); - glVertex3f(px +(normal[idx].x *NORMAL_SCALE), - py +(normal[idx].y *NORMAL_SCALE), - pz +(normal[idx].z *NORMAL_SCALE)); + glVertex3f(px +(normal[idx].x * NORMAL_SCALE), + py +(normal[idx].y * NORMAL_SCALE), + pz +(normal[idx].z * NORMAL_SCALE)); } } glEnable(GL_LIGHTING); @@ -796,12 +796,6 @@ static void render_streamlines(void) } } -static int hisdex = 0; - -void set_hisdex(int arg) { - hisdex = arg; -} - static void render_flowvis(void) { int i, j, idx, DIM; @@ -815,7 +809,16 @@ static void render_flowvis(void) 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); + history = streamlines_get_history(streamlines_get_hisdex()); + + if (flowvis_get_alpha() < 1.0f) + { + glEnable(GL_BLEND); + } + else + { + glDisable(GL_BLEND); + } glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); for (j = 0; j < DIM - 1; j++) //draw smoke |