From: <Do...@ao...> - 2001-10-22 01:29:19
|
from visual import * scene.width =3D 320 scene.height =3D 320 #scene.ambient =3D 0.05 #scene.range =3D (15,15,15) my_fov =3D 3.1415926/4.0 scene.fov =3D my_fov scene.x =3D 0 scene.y =3D 0 scene.lights =3D [vector(0,0,1.0)] #scene.ambient =3D 0 art =3D frame() topball=3Dsphere(pos=3D(0,6,0), radius=3D2, color=3D(1,0.7,0.2)) botball=3Dsphere(pos=3D(0,-2,0), radius=3D2, color=3D(1,0.7,0.2)) triangle1 =3D convex(frame =3D art,pos =3D [(2,2,2),(0,0,0),(-2,2,2)],color=20= =3D color.red) triangle2 =3D convex(frame =3D art,pos =3D [(2,2,2),(0,4,0),(-2,2,2)],color=20= =3D color.blue) triangle3 =3D convex(frame =3D art,pos =3D [(2,2,-2),(0,0,0),(-2,2,-2)],colo= r =3D color.blue) triangle4 =3D convex(frame =3D art,pos =3D [(2,2,-2),(0,4,0),(-2,2,-2)],colo= r =3D color.red) center=3Dsphere(frame =3D art,pos=3D(0,2,0), radius=3D0.5, color=3Dcolor.yel= low) box1=3Dbox(frame =3D art,pos=3D(5,2,0),axis=3D(0,1,0),Length=3D2,Width=3D2,H= eight=3D6,color=3Dcolor.yellow) box2=3Dbox(frame =3D art,pos=3D(-5,2,0),axis=3D(0,1,0),Length=3D2,Width=3D2,= Height=3D6,color=3Dcolor.yellow) box3=3Dbox(pos=3D(7,2,0),axis=3D(0,1,0),Length=3D2,Width=3D2,Height=3D9,colo= r=3D(1,0,1)) box4=3Dbox(pos=3D(-7,2,0),axis=3D(0,1,0),Length=3D2,Width=3D2,Height=3D6,col= or=3D(0,1,1)) box5=3Dbox(pos=3D(9,2,0),axis=3D(0,1,0),Length=3D2,Width=3D2,Height=3D6,colo= r=3Dcolor.red) box6=3Dbox(pos=3D(-9,2,0),axis=3D(0,1,0),Length=3D2,Width=3D2,Height=3D6,col= or=3Dcolor.red) for i in xrange(1,2000): art.rotate(angle =3D 0.1,axis =3D (0,1,0),origin =3D (0,0,0)) topball.rotate(angle =3D -0.1,axis =3D (0,1,0),origin =3D (0,0,0)) botball.rotate(angle =3D -0.1,axis =3D (0,1,0),origin =3D (0,0,0)) box3.rotate(angle =3D -0.1,axis =3D (0,1,0),origin =3D (0,0,0)) box3.rotate(angle =3D -0.3,axis =3D box3.axis,origin =3D box3.pos) box4.rotate(angle =3D -0.1,axis =3D (0,1,0),origin =3D (0,0,0)) box5.rotate(angle =3D -0.1,axis =3D (0,0,1),origin =3D (0,0,0)) box6.rotate(angle =3D -0.1,axis =3D (0,0,1),origin =3D (0,0,0)) rate(30) |