X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fextrusion-twistoid.c;h=82034afcfabe2d4facd6d20368163b6a9286ab9d;hb=8afc01a67be4fbf3f1cc0fce9adf01b5289a21c6;hp=4f388d01136cf8c61485a964ed0f901bb981bcb2;hpb=93f25dc6827112d98b8b855ea85c8f5eb8123086;p=xscreensaver diff --git a/hacks/glx/extrusion-twistoid.c b/hacks/glx/extrusion-twistoid.c index 4f388d01..82034afc 100644 --- a/hacks/glx/extrusion-twistoid.c +++ b/hacks/glx/extrusion-twistoid.c @@ -11,39 +11,27 @@ * -- port to glut Linas Vepstas March 1995 */ -/* required include files */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "extrusion.h" #include #include -#include -#include -#ifdef HAVE_GLE3 -#include -#else -#include -#endif /* Some files do not define M_PI... */ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif +/* controls shape of object */ extern float lastx; extern float lasty; -extern float rot_x; -extern float rot_y; -extern float rot_z; #define OPENGL_10 /* =========================================================== */ #define NUM_TOID1_PTS 5 -double toid1_points[NUM_TOID1_PTS][3]; -float toid1_colors [NUM_TOID1_PTS][3]; -double toid1_twists [NUM_TOID1_PTS]; +static double toid1_points[NUM_TOID1_PTS][3]; +static float toid1_colors [NUM_TOID1_PTS][3]; +static double toid1_twists [NUM_TOID1_PTS]; #define TSCALE (6.0) @@ -66,7 +54,7 @@ double toid1_twists [NUM_TOID1_PTS]; i++; \ } -void init_toid1_line (void) +static void init_toid1_line (void) { int i; @@ -112,10 +100,10 @@ void init_toid1_line (void) #define NUM_TWIS_PTS (20) -double twistation [NUM_TWIS_PTS][2]; -double twist_normal [NUM_TWIS_PTS][2]; +static double twistation [NUM_TWIS_PTS][2]; +static double twist_normal [NUM_TWIS_PTS][2]; -void init_tripples (void) +static void init_tripples (void) { int i; double angle; @@ -132,8 +120,10 @@ void init_tripples (void) } /* now, a zig-zag corrugation */ - while (i< NUM_TWIS_PTS) { + while (1) { + if (i >= NUM_TWIS_PTS) break; TWIST ((-10.0 +(double) i), 0.0); + if (i >= NUM_TWIS_PTS) break; TWIST ((-9.5 +(double) i), 1.0); } } @@ -184,14 +174,13 @@ void DrawStuff_twistoid (void) { #ifdef OPENGL_10 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glFrontFace(GL_CW); /* jwz */ + /* set up some matrices so that the object spins with the mouse */ glPushMatrix (); - glTranslatef (0.0, 0.0, -80.0); - glRotatef(rot_x, 1, 0, 0); - glRotatef(rot_y, 0, 1, 0); - glRotatef(rot_z, 0, 0, 1); -/* glRotated (43.0, 1.0, 0.0, 0.0); */ -/* glRotated (43.0, 0.0, 1.0, 0.0); */ +/* glTranslatef (0.0, 0.0, -80.0); */ +/* glRotated (43.0, 1.0, 0.0, 0.0); */ +/* glRotated (43.0, 0.0, 1.0, 0.0); */ glScaled (1.8, 1.8, 1.8); gleTwistExtrusion (NUM_TWIS_PTS, twistation, twist_normal, NULL, NUM_TOID1_PTS, toid1_points, NULL, toid1_twists);