From: Lenore H. <lh...@si...> - 2009-04-18 17:47:58
|
VPython doesn't have a radians command to turn degrees into radians? Shouldn't it squawk when he uses an illegal command? Lenore On Apr 18, 2009, at 11:40 , Bruce Sherwood wrote: > The angle used by rotations must be in radians, not degrees. > > You want ....rotate(angle=alfa*pi/180, .... > > Bruce Sherwood > > alessandro wrote: >> I want to rotate 90° around the center objects with an animation. I >> tried this: >> >> >> from visual import * >> ball = sphere(pos=(-5,0,0), radius=0.5, color=color.red) >> wallR = box(pos=(6,0,0), size=(0.2,4,4), color=color.green) >> alfa=0 >> while alfa < radians(90): >> rate(20) >> >> scene.forward = scene.forward.rotate(angle=alfa, axis=(0,1,0)) >> >> alfa += radians(1) >> >> both the sphere & box rotate but they rotate for not only for 90° but >> serveral time. Where is the error? >> >> ------------------------------------------------------------------------------ >> Stay on top of everything new and different, both inside and >> around Java (TM) technology - register by April 22, and save >> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >> 300 plus technical and hands-on sessions. Register today. >> Use priority code J9JMT32. http://p.sf.net/sfu/p >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |