diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-08 20:37:54 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-08 20:37:54 (GMT) |
commit | c3c41f66a48f40ae3471155ac302cc78175b5eac (patch) | |
tree | b34ad8798cbfa5b784c357df81b00d222c9247e9 /Smoke/fluids.c | |
parent | 63b3f9cf7f2a5d2822f62c672eabe2e893bac441 (diff) | |
download | 2iv35-c3c41f66a48f40ae3471155ac302cc78175b5eac.zip 2iv35-c3c41f66a48f40ae3471155ac302cc78175b5eac.tar.gz 2iv35-c3c41f66a48f40ae3471155ac302cc78175b5eac.tar.bz2 |
minor fixes
Diffstat (limited to 'Smoke/fluids.c')
-rw-r--r-- | Smoke/fluids.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/Smoke/fluids.c b/Smoke/fluids.c index f80a2f0..c020b2f 100644 --- a/Smoke/fluids.c +++ b/Smoke/fluids.c @@ -21,6 +21,7 @@ #include "colormap.h" #include "glyphs.h" #include "heightplots.h" +#include "normals.h" //--- SIMULATION PARAMETERS ------------------------------------------------------------------------ int var_dims = 25; @@ -96,7 +97,7 @@ fftw_real *init_simulation(int n, struct vis_data_arrays *vis_data) vis_data->div_force = (fftw_real *)malloc(dim2); vis_data->div_vel = (fftw_real *)malloc(dim1); vis_data->height = (fftw_real *)malloc(dim2); - vis_data->normals = (struct point *)malloc(dim2); + vis_data->normals = (struct point *)malloc(dim2 *sizeof(struct point *)); return return_value; } @@ -398,9 +399,11 @@ void populate_arrays(struct vis_data_arrays *vis_data) vis_data->height[idx] = calculate_height_plot(heightplots_get_dataset(), idx); - //vis_data->normals[idx] = calculate_normal_vector(vis_data->height, idx, i, j); - // printf("vis: h: %lf n: %lf; old: h: %lf n: %lf\n", - // vis_data->height[idx], vis_data->normals[idx].x, height_array[idx], normal_array[idx].x); + vis_data->normals[idx] = calculate_normal_vector(vis_data->height, idx, i, j); +// if (normal_array[idx].x != vis_data->normals[idx].x) { + // printf("n: %lf; old: %lf\n", + // vis_data->normals[idx].x, normal_array[idx].x); + //} } } } @@ -465,6 +468,7 @@ void calculate_one_simulation_step(struct vis_data_arrays *vis_data) glyphs_set_frame(frame); heightplots_set_frame(vis_data->height); + normals_set_frame(vis_data->normals); } //------ VISUALIZATION CODE STARTS HERE ----------------------------------------------------------------- @@ -537,27 +541,6 @@ float get_dataset(int index) return return_value; } -#if 0 -void set_autoscaling(void) -{ - int k; - float value, scale_min, scale_max; - - scale_min = scale_max = get_dataset(0); - colormap_set_scale_min(scale_min); - colormap_set_scale_max(scale_max); - - for (k = 1; k < DIM * DIM; k++) - { - value = get_dataset(k); - - if (scale_min > value) { colormap_set_scale_min(value); } - if (scale_max < value) { colormap_set_scale_max(value); } - } - - //threshold = (scale_min + scale_max) / 2; -} -#endif void fluids_insert_smoke(int x, int y) { |