[ODE] Ball joints

Brad braddabug at comcast.net
Fri Jul 29 15:44:39 MST 2005


I've been fighting with this thing for at least a week now.

What I want is two bodies connected via a ball joint. The 1st body is a 
"base" and just sits on the ground and doesn't move. The 2nd body is the 
body I want moving around. So I give the base a large mass and the upper 
body (the "head") a lower mass.

Let's say the head is spinning around the Z axis (the up/down axis) at a 
fairly low velocity (one revolution every five seconds or so). Now I 
want to add a torque to the body to get it to rotate around the lower 
body's X axis (since the lower body is aligned to the world, this is 
effectivly the global X axis). So I do this:

dBodyAddTorque(HeadBody, 1, 0, 0);

In my mind this should make the head continue rotating around its own Z 
axis, and then begin rotating around the global X axis. The problem is 
the head doesn't stay aligned with the Y axis (since it should be 
rotating around the X axis). Instead it begins to rotate, as if the 
body's velocity, which should be completely along the Y axis, is being 
transformed as it rotates around its Z axis.

I hope that makes sense. Can anyone tell what I'm doing wrong?


More information about the ODE mailing list