points.py

"""Draw points in 3D.
   by stephan)
"""
from slut import *

class Atlantis(World):
    def onSetup(self):
        self.width = 200
        self.height = 150
        self.name = "Points"

    def onDraw(self):
        #some explicit points
        glColor4f(1.0, 1.0, 1.0, 1.0)
        glPointSize(3)
        glBegin(GL_POINTS)
        glVertex3f(0.0 , 0.0, 0.0)
        glVertex3f(1.0 , 1.0, 0.0)
        glVertex3f(1.0 , -1.0, 0.0)
        glEnd()

        #some points in an "S" shape
        glColor4f(1.0, 0.5, 0.5, 1.0)
        glPointSize(3)
        glBegin(GL_POINTS)
        for x in range(50):
            glVertex3f(math.sin(x), math.cos(x), math.tan(x))
        glEnd()


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