uebung_while-opacity.py
uebung_while-opacity.py
—
Python Source,
1 KB
Dateiinhalt
#uebung: while, keyboard, frame, objects
from visual import *
from time import time
from math import sin,cos
f=frame()
b=box(size=(2,2,2),frame=f)
s=sphere(color=color.magenta, frame=f,y=1)
while not scene.kb.keys: # solange nichts gedrueckt...polling!
#while scene.kb.getkey(): # mit jedem Druck .. calling!
rate(25)
for i in f.objects:
i.opacity=sin(time())**2