May-02-2017, 04:45 AM
I'm trying to get the ball to fly through a series of rings, but I keep getting this error message 'ring' is not a callable object. The strange thing is when I run the code, I get a single ring and two spheres. I'm guessing it has to do with the way it's set up in the loop, but I don't know why the ring would be any different than the sphere.
Thanks
Thanks
from visual import * myuniv = display(range=vector(6,6,6)) s = vector(0,1.1,0) v = vector(9.5,0,0) a = vector(0,-9.8,0) t = 0.0 dt = 0.05 ball = sphere(pos=s,radius=.3,color=color.cyan) while s.y > -.2: s = s + v*dt print ('s=',s) v = v + a*dt t = t + dt ball.pos = s ballghost = sphere(pos=s,radius=.2) ring = ring(pos=s,axis=v,radius=1.0,color=color.red)