From: ozhan f. <ofe...@ho...> - 2005-04-04 20:29:04
|
Hello, I have installed vpython on my RedHat9 system. I tried to run some vpython demos in the demos directory. I was succesful running some of them. But when I run the lorenz.py and some other files, I get an error message saying that: ------------------------------------------------------------------------------------------- Visual-2003-10-05 Right button drag to rotate camera to view scene. Middle button drag up or down to zoom in or out. Traceback (innermost last) File "/usr/local/lib/python2.4/site-packages/visual/demos/lorenz.py", line 12, in ? lorenz = curve( color = color.black, radius=0.3 ) TypeError: CXX: type error. --------------------------------------------------------------------------------------------- I paste the vpython.py file here for debugging purpose. -------------------------------------------------------------------------------------------------- from visual import * print """ Right button drag to rotate camera to view scene. Middle button drag up or down to zoom in or out. """ scene.title = "Lorenz differential equation" scene.center = vector(25,0,0) ##scene.lights = [ ((0.25, 0.5, 1.0, 0.), (0.6,0.6,0.6)), ## ((-1.0, 0.25, -0.5), (0.2,0.2,0.2)) ] lorenz = curve( color = color.black, radius=0.3 ) # Draw grid for x in arange(0,51,10): curve( pos = [ (x,0,-25), (x,0,25) ], color = (0,0.5,0), radius = 0.3 ) #box(pos=(x,0,0), axis=(0,0,50), height=0.4, width=0.4) for z in arange(-25,26,10): curve( pos = [ (0,0,z), (50,0,z) ], color = (0,0.5,0), radius = 0.3 ) #box(pos=(25,0,z), axis=(50,0,0), height=0.4, width=0.4 ) dt = 0.01 y = vector(35, -10, -7) for t in arange(0,10,dt): # Integrate a funny differential equation dydt = vector( - 8.0/3*y[0] + y[1]*y[2], - 10*y[1] + 10*y[2], - y[1]*y[0] + 28*y[1] - y[2] ); y = y + dydt*dt # Draw lines colored by speed c = clip( [mag(dydt) * 0.005], 0, 1 )[0] lorenz.append( pos=y, red=c, blue=1-c ) rate( 500 ) --------------------------------------------------------------------------------------------------- I don't know what could be wrong. I appreciate any help. thanks, _________________________________________________________________ En etkili ve güvenilir PC Korumayi tercih edin, rahat edin! http://www.msn.com.tr/security/ |