From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[xscreensaver] / hacks / glx / sierpinski3d.c
index 078369987583a6ab0e48a054a047c0ae478b23bf..7bcefcf2c4a447837af5dcd5ce62389033292ecc 100644 (file)
@@ -327,7 +327,10 @@ draw(ModeInfo *mi)
                  (y - 0.5) * 10,
                  (z - 0.5) * 20);
 
+    /* Do it twice because we don't track the device's orientation. */
+    glRotatef( current_device_rotation(), 0, 0, 1);
     gltrackball_rotate (gp->trackball);
+    glRotatef(-current_device_rotation(), 0, 0, 1);
 
     get_rotation (gp->rot, &x, &y, &z, !gp->button_down_p);
     glRotatef (x * 360, 1.0, 0.0, 0.0);