1 /* -*- Mode: C; tab-width: 4 -*- */
2 /* moebius --- Moebius Strip II, an Escher-like GL scene with ants. */
5 static const char sccsid[] = "@(#)moebius.c 5.01 2001/03/01 xlockmore";
9 * Permission to use, copy, modify, and distribute this software and its
10 * documentation for any purpose and without fee is hereby granted,
11 * provided that the above copyright notice appear in all copies and that
12 * both that copyright notice and this permission notice appear in
13 * supporting documentation.
15 * This file is provided AS IS with no warranties of any kind. The author
16 * shall have no liability with respect to the infringement of copyrights,
17 * trade secrets or any patents by this file or any part thereof. In no
18 * event will the author be liable for any lost revenue or profits or
19 * other special, indirect and consequential damages.
21 * The RotateAroundU() routine was adapted from the book
22 * "Computer Graphics Principles and Practice
23 * Foley - vanDam - Feiner - Hughes
24 * Second Edition" Pag. 227, exercise 5.15.
26 * This mode shows some interesting scenes that are impossible OR very
27 * wierd to build in the real universe. Much of the scenes are inspirated
28 * on Mauritz Cornelis Escher's works which derivated the mode's name.
29 * M.C. Escher (1898-1972) was a dutch artist and many people prefer to
30 * say he was a mathematician.
32 * Thanks goes to Brian Paul for making it possible and inexpensive to use
35 * Since I'm not a native English speaker, my apologies for any grammatical
38 * My e-mail address is
39 * mfvianna@centroin.com.br
41 * Marcelo F. Vianna (Jun-01-1997)
44 * 05-Apr-2002: Removed all gllist uses (fix some bug with nvidia driver)
45 * 01-Mar-2001: backported from xscreensaver by lassauge@mail.dotcom.fr
46 * Feb-2001: Made motion and rotation be smoother Jamie Zawinski
48 * 01-Nov-2000: Allocation checks
49 * 01-Jan-1998: Mode separated from escher and renamed
50 * 08-Jun-1997: New scene implemented: "Impossible Cage" based in a M.C.
51 * Escher's painting with the same name (quite similar). The
52 * first GL mode to use texture mapping.
53 * The "Impossible Cage" scene doesn't use DEPTH BUFFER, the
54 * wood planks are drawn consistently using GL_CULL_FACE, and
55 * the painter's algorithm is used to sort the planks.
57 * 07-Jun-1997: Speed ups in Moebius Strip using GL_CULL_FACE.
59 * 03-Jun-1997: Initial Release (Only one scene: "Moebius Strip")
60 * The Moebius Strip scene was inspirated in a M.C. Escher's
61 * painting named Moebius Strip II in wich ants walk across a
62 * Moebius Strip path, sometimes meeting each other and sometimes
63 * being in "opposite faces" (note that the moebius strip has
64 * only one face and one edge).
69 * Texture mapping is only available on RGBA contexts, Mono and color index
70 * visuals DO NOT support texture mapping in OpenGL.
72 * BUT Mesa do implements RGBA contexts in pseudo color visuals, so texture
73 * mapping shuld work on PseudoColor, DirectColor, TrueColor using Mesa. Mono
74 * is not officially supported for both OpenGL and Mesa, but seems to not crash
77 * In real OpenGL, PseudoColor DO NOT support texture map (as far as I know).
81 #include <X11/Intrinsic.h>
86 # define PROGCLASS "Moebius"
87 # define HACK_INIT init_moebius
88 # define HACK_DRAW draw_moebius
89 # define HACK_RESHAPE reshape_moebius
90 # define HACK_HANDLE_EVENT moebius_handle_event
91 # define EVENT_MASK PointerMotionMask
92 # define moebius_opts xlockmore_opts
93 # define DEFAULTS "*delay: 20000 \n" \
94 "*showFPS: False \n" \
95 "*wireframe: False \n"
96 # include "xlockmore.h" /* from the xscreensaver distribution */
97 #else /* !STANDALONE */
98 # include "xlock.h" /* from the xlockmore distribution */
100 #endif /* !STANDALONE */
106 #include "e_textures.h"
108 #include "gltrackball.h"
110 #define DEF_SOLIDMOEBIUS "False"
111 #define DEF_NOANTS "False"
113 static int solidmoebius;
116 static XrmOptionDescRec opts[] =
118 {"-solidmoebius", ".moebius.solidmoebius", XrmoptionNoArg, "on"},
119 {"+solidmoebius", ".moebius.solidmoebius", XrmoptionNoArg, "off"},
120 {"-noants", ".moebius.noants", XrmoptionNoArg, "on"},
121 {"+noants", ".moebius.noants", XrmoptionNoArg, "off"}
123 static argtype vars[] =
125 {&solidmoebius, "solidmoebius", "Solidmoebius", DEF_SOLIDMOEBIUS, t_Bool},
126 {&noants, "noants", "Noants", DEF_NOANTS, t_Bool}
129 static OptionStruct desc[] =
131 {"-/+solidmoebius", "select between a SOLID or a NET Moebius Strip"},
132 {"-/+noants", "turn on/off walking ants"}
135 ModeSpecOpt moebius_opts =
136 {sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
139 ModStruct moebius_description =
140 {"moebius", "init_moebius", "draw_moebius", "release_moebius",
141 "draw_moebius", "change_moebius", (char *) NULL, &moebius_opts,
142 1000, 1, 1, 1, 4, 1.0, "",
143 "Shows Moebius Strip II, an Escher-like GL scene with ants", 0, NULL};
147 #define Scale4Window 0.3
148 #define Scale4Iconic 0.4
150 #define sqr(A) ((A)*(A))
156 #define ObjMoebiusStrip 0
160 /*************************************************************************/
165 GLfloat ant_position;
166 GLXContext *glx_context;
168 trackball_state *trackball;
172 static float front_shininess[] =
174 static float front_specular[] =
175 {0.7, 0.7, 0.7, 1.0};
176 static float ambient[] =
177 {0.0, 0.0, 0.0, 1.0};
178 static float diffuse[] =
179 {1.0, 1.0, 1.0, 1.0};
180 static float position0[] =
181 {1.0, 1.0, 1.0, 0.0};
182 static float position1[] =
183 {-1.0, -1.0, 1.0, 0.0};
184 static float lmodel_ambient[] =
185 {0.5, 0.5, 0.5, 1.0};
186 static float lmodel_twoside[] =
189 static float MaterialRed[] =
190 {0.7, 0.0, 0.0, 1.0};
191 static float MaterialGreen[] =
192 {0.1, 0.5, 0.2, 1.0};
193 static float MaterialBlue[] =
194 {0.0, 0.0, 0.7, 1.0};
195 static float MaterialCyan[] =
196 {0.2, 0.5, 0.7, 1.0};
197 static float MaterialYellow[] =
198 {0.7, 0.7, 0.0, 1.0};
199 static float MaterialMagenta[] =
200 {0.6, 0.2, 0.5, 1.0};
201 static float MaterialWhite[] =
202 {0.7, 0.7, 0.7, 1.0};
203 static float MaterialGray[] =
204 {0.2, 0.2, 0.2, 1.0};
205 static float MaterialGray5[] =
206 {0.5, 0.5, 0.5, 1.0};
207 static float MaterialGray6[] =
208 {0.6, 0.6, 0.6, 1.0};
209 static float MaterialGray8[] =
210 {0.8, 0.8, 0.8, 1.0};
212 static moebiusstruct *moebius = (moebiusstruct *) NULL;
217 mySphere(float radius)
219 GLUquadricObj *quadObj;
221 if ((quadObj = gluNewQuadric()) == 0)
223 gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
224 gluSphere(quadObj, radius, 16, 16);
225 gluDeleteQuadric(quadObj);
232 GLUquadricObj *quadObj;
234 if ((quadObj = gluNewQuadric()) == 0)
236 gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
237 gluCylinder(quadObj, radius, 0, radius * 3, 8, 1);
238 gluDeleteQuadric(quadObj);
243 draw_moebius_ant(moebiusstruct * mp, float *Material, int mono)
245 static float ant_step = 0;
246 float cos1 = cos(ant_step);
247 float cos2 = cos(ant_step + 2 * Pi / 3);
248 float cos3 = cos(ant_step + 4 * Pi / 3);
249 float sin1 = sin(ant_step);
250 float sin2 = sin(ant_step + 2 * Pi / 3);
251 float sin3 = sin(ant_step + 4 * Pi / 3);
254 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray5);
256 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Material);
257 glEnable(GL_CULL_FACE);
262 glScalef(1, 1 / 1.3, 1);
263 glTranslatef(0.00, 0.30, 0.00);
267 glTranslatef(-0.05, 0.17, 0.05);
268 glRotatef(-90, 1, 0, 0);
269 glRotatef(-25, 0, 1, 0);
272 glTranslatef(0.00, 0.10, 0.00);
275 glRotatef(25, 0, 1, 0);
276 glRotatef(90, 1, 0, 0);
279 glTranslatef(0.15, -0.65, 0.05);
282 glScalef(1, 1 / 1.3, 1);
284 glDisable(GL_CULL_FACE);
286 glDisable(GL_LIGHTING);
290 glColor3fv(MaterialGray5);
292 glColor3fv(Material);
293 glVertex3f(0.00, 0.30, 0.00);
294 glColor3fv(MaterialGray);
295 glVertex3f(0.40, 0.70, 0.40);
297 glColor3fv(MaterialGray5);
299 glColor3fv(Material);
300 glVertex3f(0.00, 0.30, 0.00);
301 glColor3fv(MaterialGray);
302 glVertex3f(0.40, 0.70, -0.40);
306 glColor3fv(MaterialGray6);
308 glColor3fv(MaterialRed);
309 glVertex3f(0.40, 0.70, 0.40);
310 glVertex3f(0.40, 0.70, -0.40);
314 glBegin(GL_LINE_STRIP);
316 glColor3fv(MaterialGray5);
318 glColor3fv(Material);
319 glVertex3f(0.00, 0.05, 0.18);
320 glVertex3f(0.35 + 0.05 * cos1, 0.15, 0.25);
321 glColor3fv(MaterialGray);
322 glVertex3f(-0.20 + 0.05 * cos1, 0.25 + 0.1 * sin1, 0.45);
325 /* LEFT-CENTER ARM */
326 glBegin(GL_LINE_STRIP);
328 glColor3fv(MaterialGray5);
330 glColor3fv(Material);
331 glVertex3f(0.00, 0.00, 0.18);
332 glVertex3f(0.35 + 0.05 * cos2, 0.00, 0.25);
333 glColor3fv(MaterialGray);
334 glVertex3f(-0.20 + 0.05 * cos2, 0.00 + 0.1 * sin2, 0.45);
338 glBegin(GL_LINE_STRIP);
340 glColor3fv(MaterialGray5);
342 glColor3fv(Material);
343 glVertex3f(0.00, -0.05, 0.18);
344 glVertex3f(0.35 + 0.05 * cos3, -0.15, 0.25);
345 glColor3fv(MaterialGray);
346 glVertex3f(-0.20 + 0.05 * cos3, -0.25 + 0.1 * sin3, 0.45);
349 /* RIGHT-FRONT ARM */
350 glBegin(GL_LINE_STRIP);
352 glColor3fv(MaterialGray5);
354 glColor3fv(Material);
355 glVertex3f(0.00, 0.05, -0.18);
356 glVertex3f(0.35 - 0.05 * sin1, 0.15, -0.25);
357 glColor3fv(MaterialGray);
358 glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
361 /* RIGHT-CENTER ARM */
362 glBegin(GL_LINE_STRIP);
364 glColor3fv(MaterialGray5);
366 glColor3fv(Material);
367 glVertex3f(0.00, 0.00, -0.18);
368 glVertex3f(0.35 - 0.05 * sin2, 0.00, -0.25);
369 glColor3fv(MaterialGray);
370 glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
374 glBegin(GL_LINE_STRIP);
376 glColor3fv(MaterialGray5);
378 glColor3fv(Material);
379 glVertex3f(0.00, -0.05, -0.18);
380 glVertex3f(0.35 - 0.05 * sin3, -0.15, -0.25);
381 glColor3fv(MaterialGray);
382 glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
387 glColor3fv(MaterialGray8);
389 glColor3fv(MaterialMagenta);
390 glVertex3f(-0.20 + 0.05 * cos1, 0.25 + 0.1 * sin1, 0.45);
391 glVertex3f(-0.20 + 0.05 * cos2, 0.00 + 0.1 * sin2, 0.45);
392 glVertex3f(-0.20 + 0.05 * cos3, -0.25 + 0.1 * sin3, 0.45);
393 glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
394 glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
395 glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
398 glEnable(GL_LIGHTING);
405 RotateAaroundU(float Ax, float Ay, float Az,
406 float Ux, float Uy, float Uz,
407 float *Cx, float *Cy, float *Cz,
410 float cosO = cos(Theta);
411 float sinO = sin(Theta);
412 float one_cosO = 1 - cosO;
416 float UxUy = Ux * Uy;
417 float UxUz = Ux * Uz;
418 float UyUz = Uy * Uz;
420 *Cx = (Ux2 + cosO * (1 - Ux2)) * Ax + (UxUy * one_cosO - Uz * sinO) * Ay + (UxUz * one_cosO + Uy * sinO) * Az;
421 *Cy = (UxUy * one_cosO + Uz * sinO) * Ax + (Uy2 + cosO * (1 - Uy2)) * Ay + (UyUz * one_cosO - Ux * sinO) * Az;
422 *Cz = (UxUz * one_cosO - Uy * sinO) * Ax + (UyUz * one_cosO + Ux * sinO) * Ay + (Uz2 + cosO * (1 - Uz2)) * Az;
425 #define MoebiusDivisions 40
426 #define MoebiusTransversals 4
428 draw_moebius_strip(ModeInfo * mi)
432 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
434 int mono = MI_IS_MONO(mi);
439 glBegin(GL_QUAD_STRIP);
442 while (i < (MoebiusDivisions * 2 + 1)) {
449 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
451 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
453 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
455 RotateAaroundU(cPhi, sPhi, 0, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
456 glNormal3f(Cx, Cy, Cz);
457 RotateAaroundU(0, 0, 1, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
458 glVertex3f(cPhi * 3 + Cx, sPhi * 3 + Cy, +Cz);
459 glVertex3f(cPhi * 3 - Cx, sPhi * 3 - Cy, -Cz);
461 Phi += Pi / MoebiusDivisions;
465 for (j = -MoebiusTransversals; j < MoebiusTransversals; j++) {
466 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
467 glBegin(GL_QUAD_STRIP);
470 while (i < (MoebiusDivisions * 2 + 1)) {
475 RotateAaroundU(cPhi, sPhi, 0, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
476 glNormal3f(Cx, Cy, Cz);
477 RotateAaroundU(0, 0, 1, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
479 if (j == MoebiusTransversals || mono)
480 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
482 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
484 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
485 glVertex3f(cPhi * 3 + Cx / MoebiusTransversals * j, sPhi * 3 + Cy / MoebiusTransversals * j, +Cz / MoebiusTransversals * j);
487 if (j == -MoebiusTransversals || mono)
488 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
490 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
492 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
493 glVertex3f(cPhi * 3 + Cx / MoebiusTransversals * j, sPhi * 3 + Cy / MoebiusTransversals * j, +Cz / MoebiusTransversals * j);
495 Phi += Pi / MoebiusDivisions;
500 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
506 glRotatef(mp->ant_position + 180, 0, 0, 1);
507 glTranslatef(3, 0, 0);
508 glRotatef(mp->ant_position / 2 + 90, 0, 1, 0);
509 glTranslatef(0.28, 0, -0.45);
510 if (!draw_moebius_ant(mp, MaterialYellow, mono))
514 /* DRAW YELLOW ANT */
516 glRotatef(mp->ant_position, 0, 0, 1);
517 glTranslatef(3, 0, 0);
518 glRotatef(mp->ant_position / 2, 0, 1, 0);
519 glTranslatef(0.28, 0, -0.45);
520 if (!draw_moebius_ant(mp, MaterialBlue, mono))
526 glRotatef(-mp->ant_position, 0, 0, 1);
527 glTranslatef(3, 0, 0);
528 glRotatef(-mp->ant_position / 2, 0, 1, 0);
529 glTranslatef(0.28, 0, 0.45);
530 glRotatef(180, 1, 0, 0);
531 if (!draw_moebius_ant(mp, MaterialGreen, mono))
537 glRotatef(-mp->ant_position + 180, 0, 0, 1);
538 glTranslatef(3, 0, 0);
539 glRotatef(-mp->ant_position / 2 + 90, 0, 1, 0);
540 glTranslatef(0.28, 0, 0.45);
541 glRotatef(180, 1, 0, 0);
542 if (!draw_moebius_ant(mp, MaterialCyan, mono))
546 mp->ant_position += 1;
549 #undef MoebiusDivisions
550 #undef MoebiusTransversals
553 reshape_moebius(ModeInfo * mi, int width, int height)
555 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
557 glViewport(0, 0, mp->WindW = (GLint) width, mp->WindH = (GLint) height);
558 glMatrixMode(GL_PROJECTION);
560 glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
561 glMatrixMode(GL_MODELVIEW);
565 } else if (width >= 512) {
579 glClearColor(0.0, 0.0, 0.0, 1.0);
581 glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
582 glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
583 glLightfv(GL_LIGHT0, GL_POSITION, position0);
584 glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
585 glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
586 glLightfv(GL_LIGHT1, GL_POSITION, position1);
587 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
588 glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
589 glEnable(GL_LIGHTING);
592 glEnable(GL_NORMALIZE);
597 glShadeModel(GL_SMOOTH);
598 glEnable(GL_DEPTH_TEST);
599 glDisable(GL_TEXTURE_2D);
600 glDisable(GL_CULL_FACE);
602 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
605 status = gluBuild2DMipmaps(GL_TEXTURE_2D, 3,
606 WoodTextureWidth, WoodTextureHeight,
607 GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
610 const char *s = (char *) gluErrorString (status);
611 fprintf (stderr, "%s: error mipmapping %dx%d texture: %s\n",
612 progname, WoodTextureWidth, WoodTextureHeight,
613 (s ? s : "(unknown)"));
616 check_gl_error("mipmapping");
618 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
619 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
620 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
621 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
622 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
624 glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
625 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
631 release_moebius(ModeInfo * mi)
633 if (moebius != NULL) {
634 (void) free((void *) moebius);
635 moebius = (moebiusstruct *) NULL;
641 moebius_handle_event (ModeInfo *mi, XEvent *event)
643 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
645 if (event->xany.type == ButtonPress &&
646 event->xbutton.button & Button1)
648 mp->button_down_p = True;
649 gltrackball_start (mp->trackball,
650 event->xbutton.x, event->xbutton.y,
651 MI_WIDTH (mi), MI_HEIGHT (mi));
654 else if (event->xany.type == ButtonRelease &&
655 event->xbutton.button & Button1)
657 mp->button_down_p = False;
660 else if (event->xany.type == MotionNotify &&
663 gltrackball_track (mp->trackball,
664 event->xmotion.x, event->xmotion.y,
665 MI_WIDTH (mi), MI_HEIGHT (mi));
674 init_moebius(ModeInfo * mi)
678 if (moebius == NULL) {
679 if ((moebius = (moebiusstruct *) calloc(MI_NUM_SCREENS(mi),
680 sizeof (moebiusstruct))) == NULL)
683 mp = &moebius[MI_SCREEN(mi)];
684 mp->step = NRAND(90);
685 mp->ant_position = NRAND(90);
688 double rot_speed = 0.3;
689 mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
690 mp->trackball = gltrackball_init ();
693 if ((mp->glx_context = init_GL(mi)) != NULL) {
695 reshape_moebius(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
696 glDrawBuffer(GL_BACK);
704 draw_moebius(ModeInfo * mi)
708 Display *display = MI_DISPLAY(mi);
709 Window window = MI_WINDOW(mi);
713 mp = &moebius[MI_SCREEN(mi)];
715 MI_IS_DRAWN(mi) = True;
717 if (!mp->glx_context)
720 glXMakeCurrent(display, window, *(mp->glx_context));
722 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
726 glTranslatef(0.0, 0.0, -10.0);
728 gltrackball_rotate (mp->trackball);
730 if (!MI_IS_ICONIC(mi)) {
731 glScalef(Scale4Window * mp->WindH / mp->WindW, Scale4Window, Scale4Window);
733 glScalef(Scale4Iconic * mp->WindH / mp->WindW, Scale4Iconic, Scale4Iconic);
738 get_rotation (mp->rot, &x, &y, &z, !mp->button_down_p);
739 glRotatef (x * 360, 1.0, 0.0, 0.0);
740 glRotatef (y * 360, 0.0, 1.0, 0.0);
741 glRotatef (z * 360, 0.0, 0.0, 1.0);
745 if (!draw_moebius_strip(mi)) {
752 if (MI_IS_FPS(mi)) do_fps (mi);
755 glXSwapBuffers(display, window);
761 change_moebius(ModeInfo * mi)
763 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
765 if (!mp->glx_context)
768 glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(mp->glx_context));