root / PyOpenGL-Demo / GLE / helix.py @ 2
Historique | Voir | Annoter | Télécharger (771 octet)
| 1 |
#!/usr/bin/python
|
|---|---|
| 2 |
|
| 3 |
# This is statement is required by the build system to query build info
|
| 4 |
if __name__ == '__build__': |
| 5 |
raise Exception |
| 6 |
|
| 7 |
|
| 8 |
from OpenGL.GL import * |
| 9 |
from OpenGL.GLUT import * |
| 10 |
from OpenGL.GLE import * |
| 11 |
import maintest |
| 12 |
|
| 13 |
maintest.lastx = 121.0
|
| 14 |
maintest.lasty = 121.0
|
| 15 |
|
| 16 |
|
| 17 |
def DrawStuff(): |
| 18 |
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) |
| 19 |
# set up some matrices so that the object spins with the mouse
|
| 20 |
gleSetJoinStyle (TUBE_NORM_EDGE | TUBE_JN_ANGLE | TUBE_JN_CAP) |
| 21 |
glColor3f (0.6, 0.8, 0.3) |
| 22 |
|
| 23 |
glPushMatrix () |
| 24 |
glTranslatef (0.0, 0.0, -80.0) |
| 25 |
glRotatef (maintest.lastx, 0.0, 1.0, 0.0) |
| 26 |
glRotatef (maintest.lasty, 1.0, 0.0, 0.0) |
| 27 |
|
| 28 |
gleHelicoid (1.0, 6.0, 2.0, -3.0, 4.0, None, None, 0.0, 1080.0) |
| 29 |
|
| 30 |
glPopMatrix () |
| 31 |
|
| 32 |
glutSwapBuffers () |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
maintest.main(DrawStuff) |