summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilrik de Loose <wilrik@wilrik.nl>2008-01-09 15:04:24 (GMT)
committerWilrik de Loose <wilrik@wilrik.nl>2008-01-09 15:04:24 (GMT)
commit19104903490d2c67f9b385804a7f89df8f6fc48c (patch)
tree5996af7dddde1e4ae3513cfebf8d2c99d281cae5
parenteac915db1c03ec7a59286d529ca578cf11b21650 (diff)
download2iv35-19104903490d2c67f9b385804a7f89df8f6fc48c.zip
2iv35-19104903490d2c67f9b385804a7f89df8f6fc48c.tar.gz
2iv35-19104903490d2c67f9b385804a7f89df8f6fc48c.tar.bz2
nieuwe colormap fire
-rw-r--r--Smoke/Week 2.suobin73728 -> 76288 bytes
-rw-r--r--Smoke/gtk.c10
-rw-r--r--Smoke/gtk_isolines.c4
-rw-r--r--Smoke/palette.c24
-rw-r--r--Smoke/renderer_gl.c12
5 files changed, 16 insertions, 34 deletions
diff --git a/Smoke/Week 2.suo b/Smoke/Week 2.suo
index 52b0292..55c5b7c 100644
--- a/Smoke/Week 2.suo
+++ b/Smoke/Week 2.suo
Binary files differ
diff --git a/Smoke/gtk.c b/Smoke/gtk.c
index 537a7f3..6e519b5 100644
--- a/Smoke/gtk.c
+++ b/Smoke/gtk.c
@@ -783,13 +783,13 @@ create_window (GdkGLConfig *glconfig, struct vis_data_arrays *vis_data)
gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label);
- notebook_page_label = gtk_label_new("Divergence");
- gtk_widget_show(notebook_page_label);
+ //notebook_page_label = gtk_label_new("Divergence");
+ //gtk_widget_show(notebook_page_label);
- notebook_page = create_divergence_page();
- gtk_widget_show(notebook_page);
+ //notebook_page = create_divergence_page();
+ //gtk_widget_show(notebook_page);
- gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label);
+ //gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label);
notebook_page_label = gtk_label_new("Isolines");
gtk_widget_show(notebook_page_label);
diff --git a/Smoke/gtk_isolines.c b/Smoke/gtk_isolines.c
index 6e9c7a9..a2b213a 100644
--- a/Smoke/gtk_isolines.c
+++ b/Smoke/gtk_isolines.c
@@ -204,7 +204,7 @@ GtkWidget *create_isolines_page(void)
gtk_box_pack_start(GTK_BOX(box), scale, FALSE, TRUE, 0);
gtk_widget_show(scale);
- label = gtk_label_new("Minimum threshold value");
+ label = gtk_label_new("Threshold value 1");
gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
gtk_widget_show(label);
@@ -217,7 +217,7 @@ GtkWidget *create_isolines_page(void)
gtk_box_pack_start(GTK_BOX(box), scale, FALSE, TRUE, 0);
gtk_widget_show(scale);
- label = gtk_label_new("Maximum threshold value");
+ label = gtk_label_new("Threshold value 2");
gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
gtk_widget_show(label);
diff --git a/Smoke/palette.c b/Smoke/palette.c
index 91b944f..a17c143 100644
--- a/Smoke/palette.c
+++ b/Smoke/palette.c
@@ -155,30 +155,14 @@ static struct color4f trip_like_i_do(float value)
return return_value;
}
+
static struct color4f colormap_fire(float value)
{
struct color4f return_value;
- /* Colormap Fire
- * A fire effect deals with two parts, first a drop from red to yellow (halfway)
- * during which time the Red component remains full e.g. 1. The Green component is
- * slowly added to turn the red into orange, and then yellow (R & G =Y). After this
- * point, the Red and Green component (e.g. yellow) have to drop simulataniously
- * to go from yellow down to black.
- */
- return_value.r = 0;
- return_value.b = 0;
- return_value.g = 0;
- if (value <= (0.01)) {
- /* whilst value is 0 - 0.5 both red and green equally change to create yellow */
- return_value.r = return_value.g = value;
- } else {
- /* whilst value is 0.5 - 1 Red is always fully on while the Green component is
- * added in steps to go from red to orange to yellow.
- */
- return_value.g = 0.9f - value;
- return_value.r = 0.8f; // not 1, makes red deeper, more intense
- }
+ return_value.r = value;
+ return_value.g = value / 5.0f;
+ return_value.b = 0.0f;
return return_value;
}
diff --git a/Smoke/renderer_gl.c b/Smoke/renderer_gl.c
index 59489c5..0ce22e7 100644
--- a/Smoke/renderer_gl.c
+++ b/Smoke/renderer_gl.c
@@ -562,7 +562,7 @@ static void render_isolines(void)
{
int idx, count, i, j, state, DIM;
float wn, hn, v0, v1, v2, v3, threshold, iso_scale;
- float x0, y0, z0, x1, y1, z1, x_offset, y_offset;
+ float x_offset, y_offset, z_pos = 8.0f;
struct color4f color;
struct point p0, p1, p2, p3, e1, e2;
@@ -571,8 +571,6 @@ static void render_isolines(void)
wn = (fftw_real)winWidth / (fftw_real)(DIM + 1); // Grid cell width
hn = (fftw_real)winHeight / (fftw_real)(DIM + 1); // Grid cell height
- z0 = z1 = 8.0f;
-
if (isolines_get_nr())
{
iso_scale = fabs(isolines_get_threshold_min() - isolines_get_threshold_max()) / isolines_get_nr();
@@ -614,19 +612,19 @@ static void render_isolines(void)
p0.x = x_offset;
p0.y = y_offset + hn;
- p0.z = z0;
+ p0.z = z_pos;
p1.x = x_offset + wn;
p1.y = y_offset + hn;
- p1.z = z0;
+ p1.z = z_pos;
p2.x = x_offset + wn;
p2.y = y_offset;
- p2.z = z0;
+ p2.z = z_pos;
p3.x = x_offset;
p3.y = y_offset;
- p3.z = z0;
+ p3.z = z_pos;
switch(state)
{