diff options
author | Wilrik de Loose <wilrik@wilrik.nl> | 2007-12-14 12:24:12 (GMT) |
---|---|---|
committer | Wilrik de Loose <wilrik@wilrik.nl> | 2007-12-14 12:24:12 (GMT) |
commit | dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18 (patch) | |
tree | a5f54b566e9c4b7fe34edb7ef0a271fa56bb8d2b /Smoke/glyphs.c | |
parent | 9aaa000d79789033ea531c7d2c140fee1283305c (diff) | |
download | 2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.zip 2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.tar.gz 2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.tar.bz2 |
Diffstat (limited to 'Smoke/glyphs.c')
-rw-r--r-- | Smoke/glyphs.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Smoke/glyphs.c b/Smoke/glyphs.c index 9dd2914..751179e 100644 --- a/Smoke/glyphs.c +++ b/Smoke/glyphs.c @@ -11,21 +11,21 @@ void render_glyph(float x_value, float y_value, float i, float j)
{
- float x0, y0, z0, x1, y1, z1, x_dev, y_dev, z_dev, size, length;
+ float x0, y0, z0, x1, y1, z1, x_dev, y_dev, size, length;
float scale = (float)((float)DIM / (float)get_var_dims()) / 6;
double theta, in_prod;
- fftw_real wn, hn; - - GLuint startList = glGenLists(1); - GLUquadricObj *qobj = gluNewQuadric(); - - gluQuadricDrawStyle(qobj, GLU_FILL); - gluQuadricNormals(qobj, GLU_SMOOTH); - glNewList(startList, GL_COMPILE); - gluCylinder(qobj, 10, 0.2, 8, 8, 8); + fftw_real wn, hn;
+
+ GLuint startList = glGenLists(1);
+ GLUquadricObj *qobj = gluNewQuadric();
+
+ gluQuadricDrawStyle(qobj, GLU_FILL);
+ gluQuadricNormals(qobj, GLU_SMOOTH);
+ glNewList(startList, GL_COMPILE);
+ gluCylinder(qobj, 10, 0.2, 8, 8, 8);
glEndList();
- size = sqrt((x_value * x_value * 20) + (y_value * y_value * 20)) * 3 * scale;
+ size = quake_root((x_value * x_value * 20) + (y_value * y_value * 20)) * 3 * scale;
wn = (fftw_real)winWidth / (fftw_real)(get_var_dims() + 1); // Grid cell width
hn = (fftw_real)winHeight / (fftw_real)(get_var_dims() + 1); // Grid cell heigh
@@ -41,7 +41,7 @@ void render_glyph(float x_value, float y_value, float i, float j) // inner product
x_dev = x1 - x0;
y_dev = y1 - y0;
- length = sqrt(x_dev * x_dev + y_dev * y_dev);
+ length = quake_root(x_dev * x_dev + y_dev * y_dev);
x_dev = (length == 0) ? 0 : x_dev / length;
y_dev = (length == 0) ? 1 : y_dev / length;
@@ -79,7 +79,7 @@ void render_glyph(float x_value, float y_value, float i, float j) case GLYPH_CYLINDERS:
x_dev = x1 - x0;
y_dev = y1 - y0;
- length = sqrt(x_dev * x_dev + y_dev * y_dev) / 8;
+ length = quake_root(x_dev * x_dev + y_dev * y_dev) / 8;
glPushMatrix();
@@ -104,6 +104,9 @@ void render_glyph(float x_value, float y_value, float i, float j) glPopMatrix();
break;
}
+
+ gluDeleteQuadric(qobj);
+ glDeleteLists(startList, 1);
}
void draw_glyphs(void)
@@ -138,7 +141,7 @@ void draw_glyphs(void) break;
}
- set_colormap(value, FALSE, 0.5f);
+ set_colormap(scalar_col, value, FALSE, 0.5f);
switch (glyph_vector)
{
default:
|