From: Joel K. <jj...@ya...> - 2004-05-29 21:36:14
|
The source code that I put below the dotted line shows an unusual way of employing the "faces" object. Teachers of math and/or computer science might want to challenge their students to figure out how and why the program produces the visual output that it does. The code allows for lots of variations to experiment with in just about all of its sections. I'm afraid that the long "fa.append" line got messed up by my email system, but it should be easy to fix. Joel .............................................. from visual import * from time import * autocenter = 1 scene = display() scene.width = 1024 scene.height = 738 scene.x = 0 scene.y = 0 # Rotating 'Faces' Object fr = frame () fa = faces (frame = fr) range = 20.0 step = pi / range for nn in arange (-range, range, step): for qq in arange (-range, range, step): fa.append (pos = (cos (nn), sin (qq), sin (qq + nn)), normal = (0.99, 0.99, 0.99), green = nn / range, blue = qq / range) while 2.0 > 1.0: tt = 8000.0 / time () fr.rotate (angle = tt, axis = (step, step, step)) __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |