thrust.py

"""Thrust transformation on a sprite.
   by stephan)
"""
from slut import *

class Atlantis(World):
    def onSetup(self):
        self.name = "Thrusts"
        p = Polygon(self, 'poly1')
        p.moveBy(1.0, 0.0, 0.0)
        p.rotBy(Thrust(180.0, 0.0, 0.0))
        p.orbitBy(Thrust(0.0, 0.0, 20.0))


class Polygon(Sprite):
    def onDraw(self):
        glBegin(GL_POLYGON)
        glVertex3f(0.0, 0.0, 0.0)
        glVertex3f(1.0, 0.0, 0.0)
        glVertex3f(1.0, 1.0, 0.0)
        glVertex3f(-0.5, 1.5, 0.0)
        glVertex3f(0.0, 0.0, 0.0)
        glEnd()


atlantis = Atlantis()
atlantis.run()
Initiated by Stephan Hechenberger
Thanks to CADRE's 103