line.py

"""Draw 2D/3D lines, orthographic versus perspective.
   by stephan)
"""
from slut import *

class Atlantis(World):
    def onSetup(self):
        self.width = 400
        self.height = 300

    def onDraw(self):
        """Draw shapes with perspective."""
        #2D line
        line(1, 0, -1, 0)
        #3D line
        line(1, 0.2, 0,
            -1, 0.2, -10)

    def onDrawOrtho(self):
        """Draw shapes without perspective -> orthographic."""
        #2D line
        line(100, 100, 300, 100)
        #3D line -> looks the same
        line(100, 105, -120,
             300, 105, 120)


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