Posted: 26th Mar 2010 19:40
in the code below, just trying to get the top box to rotate through 180 degrees ontop of the other box but is moving with a larger degree of freedom:
sync on
sync rate 60
autocam off
phy start
position camera 0,0,0
position camera 0,8,-10
rotate camera 20,0,0
make object box 1,5,5,5
position object 1,0,0,0
phy make rigid body static box 1
make object box 2,2,2,2
position object 2,0,3.5,0
phy make rigid body dynamic box 2
phy make revolute joint 1,1,2
phy set revolute joint global anchor 1,2,0,3.5,0
phy set revolute joint global axis 1,2,0,1,0
phy set revolute joint limit 1,-90,90
phy build revolute joint 1
do
set cursor 0,0
print object angle y(2)
if leftkey()=1
PHY ADD RIGID BODY LOCAL TORQUE 2,0,-1000,0,1
endif
if rightkey()=1
PHY ADD RIGID BODY LOCAL TORQUE 2,0,1000,0,1
endif
phy update
sync
loop