diff options
Diffstat (limited to 'Smoke/renderer_gl.c')
-rw-r--r-- | Smoke/renderer_gl.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Smoke/renderer_gl.c b/Smoke/renderer_gl.c index 9bbd754..57ed71f 100644 --- a/Smoke/renderer_gl.c +++ b/Smoke/renderer_gl.c @@ -764,12 +764,16 @@ static void render_streamlines(void) struct point p; struct fftw_real_xy *frame_history; fftw_real cell_x, cell_y; + float scale = 10.0f; + + glLineWidth(2.5f); i = j = k = l = 0; DIM = fluids_get_dim(); for (i = 0; i < get_cur_seedpoint(); i++) { p = get_seedpoint(i); + p.y = winHeight - p.y; glBegin(GL_LINE_STRIP); @@ -783,15 +787,19 @@ static void render_streamlines(void) idx_x = round(p.x / cell_x); idx_y = round(p.y / cell_y); - idx = (int)(cell_x * cell_y); + idx = (idx_x + (idx_y * DIM)) % (DIM * DIM); vx = (float)frame_history->x[idx]; vy = (float)frame_history->y[idx]; - glVertex3f(p.x + (vx * 10000), winHeight - p.y + (vy * 10000), 0.0f - j * cell_x); + p.x += vx * cell_x * scale; + p.y += vy * cell_y * scale; + + glVertex3f(p.x, p.y, j * cell_x); } glEnd(); } + glLineWidth(1.0f); } static void render_flowvis(void) |