summaryrefslogtreecommitdiffstats
path: root/Smoke/streamlines.c
diff options
context:
space:
mode:
authorWilrik de Loose <wilrik@wilrik.nl>2007-12-14 14:31:07 (GMT)
committerWilrik de Loose <wilrik@wilrik.nl>2007-12-14 14:31:07 (GMT)
commit241bfc64ed6446c295846d5ae635f6ba4e25a666 (patch)
treee7984b4511e52770ff154f02e486f36030e0eb16 /Smoke/streamlines.c
parent6c1d686104ee1ecc3cfdad13ee2177041928e58f (diff)
download2iv35-241bfc64ed6446c295846d5ae635f6ba4e25a666.zip
2iv35-241bfc64ed6446c295846d5ae635f6ba4e25a666.tar.gz
2iv35-241bfc64ed6446c295846d5ae635f6ba4e25a666.tar.bz2
lalala niet veel nieuws
Diffstat (limited to 'Smoke/streamlines.c')
-rw-r--r--Smoke/streamlines.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/Smoke/streamlines.c b/Smoke/streamlines.c
index 51e9fa0..2dc7714 100644
--- a/Smoke/streamlines.c
+++ b/Smoke/streamlines.c
@@ -8,18 +8,35 @@
#include "fluids.h"
#include "streamlines.h"
#include "seedpoint.h"
+#include "funcs.h"
void render_streamlines(void)
{
- int i, j, max;
- i = j = max = 0;
+ int i, j, k, l, idx;
+ float v;
+ struct point p;
+ int *frame_history;
+ fftw_real cell_x, cell_y;
- max = get_cur_seedpoint();
+ i = j = k = l = 0;
- for (i = 0; i < max; i++)
+ for (i = 0; i < get_cur_seedpoint(); i++)
{
- while (frame_hist[j] != NULL)
+ p = get_seedpoint(i);
+
+ while (j < DIM)
{
+ 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
+
+ cell_x = round(p.x / cell_x);
+ cell_y = round(p.y / cell_y);
+
+ idx = cell_x + (cell_y * DIM) + (j * DIM * DIM);
+ //v = frame_history[idx];
+
j++;
}
}