Mittwoch, 22. Juli 2009
Python 026
from visual import *
scene.width=900
scene.height=700
scene.center=(100,0,100)
abstandbaelle=.1
nballi = 20
nballj = 20
xvar=nballi*nballj
ball = []
line = []
for x in range(xvar):
ball.append(1)
line.append(1)
for i in range(nballi):
for j in range(nballj):
ball[i*nballi+j] = sphere(pos=(8,j*abstandbaelle,i*abstandbaelle), radius=.1)
line[i*nballi+j] = curve(pos=[(8,j*abstandbaelle,i*abstandbaelle)], radius=.3, color=(i/6,i*j/12,j/6))
for i in range(1000):
for i in range(nballi):
for j in range(nballj):
ball[i*nballi+j].pos += sin((ball[i*nballi+j].pos)/30)
line[i*nballi+j].append((ball[i*nballi+j].pos))
Abonnieren
Kommentare zum Post (Atom)
Keine Kommentare:
Kommentar veröffentlichen