[ODE] Controlling a sphere
Svenne Nilsson
svenne979 at hotmail.com
Wed Feb 11 23:01:09 MST 2004
Hi!
I am having trouble controlling a sphere with a joypad.
When I steer left and right on the pad I want the sphere to turn around the
worlds y-axis (+y is up) and when i push forward and back I want the sphere
to roll, or reverse around the spheres own x-axis (+x is right). It seems
like a simple problem to me, but I can't seem to get it to work.
dBodyAddTorque(bodyid, 0.0f, steerrate, 0.0f) works fine rotating left &
right, but I guess I need to rotate the vector for moving forward and back,
and I can't seem to get the math correct.
dBodyAddTourque(bodyid, speed, 0.0f, 0.0f) obviously always moves the ball
in the world z-direction, dBodyAddRelTourque(bodyid, speed, 0.0f, 0.0f)
doesn't work either because the local x-axis of the sphere can be in any
direction depending on rotation and so on.
If anyone can point me in the right direction or have implemented something
similar and would like to help me I'd be very happy....
_________________________________________________________________
Hitta rätt på nätet med MSN Sök http://search.msn.se/
More information about the ODE
mailing list