From: Joel K. <jj...@ya...> - 2004-06-02 19:42:58
|
The source code below demonstrates how strange things can get when you use a 'curve' object with a very wide radius and a lot of changes taking place. As is common, the exact performance of this program can vary significantly with your hardware configuration. Have fun tinkering with parameters. Joel ............................................ from visual import * from time import * # Joel Kahn # 2004 # jj...@ya... # This program is free software; # you can redistribute it and/or # modify it under the applicable # terms of the GNU General Public # License as published by the Free # Software Foundation; either # version 2 of the License, or (at # your option) any later version. # This program is distributed in # the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even # the implied warranty of # MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU # General Public License for more details. autocenter = 1 scene = display() scene.width = 1024 scene.height = 738 scene.x = 0 scene.y = 0 fr1 = frame () cu1 = curve (frame = fr1, radius = 2000.0) cu1.append (pos = (0.0, 0.0, 0.0)) cu1.append (pos = (0.0, 0.0, 0.0)) cu1.append (pos = (0.0, 0.0, 0.0)) cu1.append (pos = (0.0, 0.0, 0.0)) cu1.append (pos = (0.0, 0.0, 0.0)) cu1.append (pos = (0.0, 0.0, 0.0)) cu1.append (pos = (0.0, 0.0, 0.0)) mm0 = 0.0 mm1 = 0.0 mm2 = 0.0 mm3 = 0.0 mm4 = 0.0 mm5 = 0.0 mm6 = 0.0 step0 = 0.00031 step1 = 0.00029 step2 = 0.00023 step3 = 0.00019 step4 = 0.00017 step5 = 0.00013 step6 = 0.00011 while 2.0 > 1.0: mm0 = mm0 + step0 - 1.0 / time () cu1.x[0] = cu1.x[0] + cos (mm0) - 1.0 / time () cu1.y[0] = cu1.y[0] + sin (mm0) - 1.0 / time () cu1.red[0] = abs (cos (mm0)) - 1.0 / time () cu1.green[0] = abs (cos (mm1)) - 1.0 / time () cu1.blue[0] = abs (cos (mm2)) - 1.0 / time () mm1 = mm1 + step1 - 1.0 / time () cu1.y[1] = cu1.y[1] + cos (mm1) - 1.0 / time () cu1.z[1] = cu1.z[1] + sin (mm1) - 1.0 / time () cu1.red[1] = abs (sin (mm1)) - 1.0 / time () cu1.green[1] = abs (sin (mm2)) - 1.0 / time () cu1.blue[1] = abs (sin (mm3)) - 1.0 / time () mm2 = mm2 + step2 - 1.0 / time () cu1.x[2] = cu1.x[2] + cos (mm2) - 1.0 / time () cu1.z[2] = cu1.z[2] + sin (mm2) - 1.0 / time () cu1.red[2] = abs (cos (mm2)) - 1.0 / time () cu1.green[2] = abs (cos (mm3)) - 1.0 / time () cu1.blue[2] = abs (cos (mm4)) - 1.0 / time () mm3 = mm3 + step3 - 1.0 / time () cu1.x[3] = cu1.x[3] + cos (mm3) - 1.0 / time () cu1.y[3] = cu1.y[3] + sin (mm3) - 1.0 / time () cu1.red[3] = abs (sin (mm3)) - 1.0 / time () cu1.green[3] = abs (sin (mm4)) - 1.0 / time () cu1.blue[3] = abs (sin (mm5)) - 1.0 / time () mm4 = mm4 + step4 - 1.0 / time () cu1.y[4] = cu1.y[4] + cos (mm4) - 1.0 / time () cu1.z[4] = cu1.z[4] + sin (mm4) - 1.0 / time () cu1.red[4] = abs (cos (mm4)) - 1.0 / time () cu1.green[4] = abs (cos (mm5)) - 1.0 / time () cu1.blue[4] = abs (cos (mm6)) - 1.0 / time () mm5 = mm5 + step5 - 1.0 / time () cu1.x[5] = cu1.x[5] + cos (mm5) - 1.0 / time () cu1.z[5] = cu1.z[5] + sin (mm5) - 1.0 / time () cu1.red[5] = abs (sin (mm5)) - 1.0 / time () cu1.green[5] = abs (sin (mm6)) - 1.0 / time () cu1.blue[5] = abs (sin (mm0)) - 1.0 / time () mm6 = mm6 + step6 - 1.0 / time () cu1.x[6] = cu1.x[6] + cos (mm6) - 1.0 / time () cu1.y[6] = cu1.y[6] + sin (mm6) - 1.0 / time () cu1.red[6] = abs (cos (mm6)) - 1.0 / time () cu1.green[6] = abs (cos (mm0)) - 1.0 / time () cu1.blue[6] = abs (cos (mm1)) - 1.0 / time () __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |