Links und Funktionen
Sprachumschaltung

Navigationspfad
Sie sind hier: Startseite / Probestudium / 2013 / WS I: 3D-Programmierung / Tutorials / Einführung in (V)Python / koordinatensystem.py


Inhaltsbereich

koordinatensystem.py

koordinatensystem.py — text/python-source, 1 KB (1377 bytes)

Dateiinhalt

# Ein Koordinatensystem mit visual

# Einbinden des 3D-Moduls
from visual import *

# Szene-Einstellungen
scene.userzoom = True           # User darf zoomen?
scene.userspin = True           # User darf rotieren?
scene.forward = (-1,-1,-1)      # Kameraposition
scene.autoscale = False         # Autoskalierung aktiv?
scene.range = 12                # Kameraabstand von scene.center
scene.center = (0,0,0)          # Kamerablickpunkt: norm. (0,0,0)
scene.up = (0,1,0)              # Rotationsachse Kamera: norm. (0,1,0)
scene.background = color.black  # Hintergrundfarbe
scene.fov = 1                   # Kamerawinkeloeffnung: norm. 1
scene.fullscreen = False        # Vollbild? norm. False
scene.title = "Koordinaten"     # Fenstertitel
scene.width = 200               # Fensterbreite: norm. 200
scene.height = 200              # Fensterhoehe: norm 200
scene.x = 50                    # x-Koordinate d. Fensters: norm. 0
scene.y = 25                    # y-Koordinate d. Fensters: norm. 0

# Koordinatenachsen in Form von Pfeilen
xAchse = arrow(axis=(10,0,0), shaftwidth=0.05, color=color.red)
yAchse = arrow(axis=(0,10,0), shaftwidth=0.05, color=(0,0,1))
zAchse = arrow(axis=(0,0,10), shaftwidth=0.05, color=color.green)

# Beschriftungen
xLabel = label(pos=(10,0,0), text="x-Achse")
yLabel = label(pos=(0,10,0), text="y-Achse")
zLabel = label(pos=(0,0,10), text="z-Achse")



Funktionsleiste