PDA

View Full Version : about setMotorAngle


amaze12
02-29-2012, 08:57 AM
Hello ,

I just tried the fowllowing code.

import viz
viz.go()

ball = viz.add('ball.wrl',pos=(1,1.8,5))
ball.collideSphere()

ANCHOR_POS = (0,1.8,5)
viz.add('white_ball.wrl',pos=ANCHOR_POS) # Anchor Model

joint = viz.phys.addHingeJoint(ball,None,pos=ANCHOR_POS,ax is0=[0,0,1])
joint.setMotorAngle(0,90,.26,1)

import vizcam
cam = vizcam.pivotNavigate()
cam.setCenter(1,1.8,5)
cam.setDistence(1)

So I have a ball in view, and I can rotate it with my mouse, and if I rotate it upward or downward, the ball rotation is limited. I think maybe the angle are limited by the second argument (90) in setMotorAngle. But when I tried to change the number, for example, to 1 or 10, nothing changed.

Please tell me what's wrong?

Or if this setMotorAngle cannot work like this. Which function can?

Thank you.