3 * helicoid (gernalized torus) demo
6 * This code provides a very simple example of the helicoid primitive.
7 * Most of this code is required to set up OpenGL and GLUT, and very
8 * very little to set up the helix drawer. Don't blink!
10 * =======> MOUSE HOOKED UP TO AFFINE < ========
13 * Written by Linas Vepstas, March 1995
16 /* required include files */
21 /* most recent mouse postion */
28 void InitStuff_helix4 (void)
32 /* draw the helix shape */
33 void DrawStuff_helix4 (void)
36 double delta_affine[2][3];
38 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
39 glColor3f (0.7, 0.5, 0.3);
41 /* set up some matrices so that the object spins with the mouse */
43 glTranslatef (0.0, 0.0, -80.0);
44 glRotatef(rot_x, 1, 0, 0);
45 glRotatef(rot_y, 0, 1, 0);
46 glRotatef(rot_z, 0, 0, 1);
47 /* glRotatef (220.0, 0.0, 1.0, 0.0); */
48 /* glRotatef (65.0, 1.0, 0.0, 0.0); */
50 /* Phew. FINALLY, Draw the helix -- */
51 affine [0][0] = 1.0/ (0.01*lastx);
54 affine [1][1] = 0.01*lastx;
58 delta_affine [0][0] = 0.0;
59 delta_affine [1][0] = 0.03*lasty;
60 delta_affine [0][1] = -0.03*lasty;
61 delta_affine [1][1] = 0.0;
62 delta_affine [0][2] = 0.0;
63 delta_affine [1][2] = 0.0;
65 gleSetJoinStyle (TUBE_NORM_EDGE | TUBE_JN_ANGLE | TUBE_JN_CAP);
66 gleHelicoid (1.0, 7.0, -1.0,
67 -4.0, 6.0, affine, delta_affine, 0.0, 980.0);
72 /* ------------------------- end of file ----------------- */