[ODE] Controlling a sphere

Svenne Nilsson svenne979 at hotmail.com
Thu Feb 12 11:37:15 MST 2004


Nevermind, brain started functioning again ..... Got my solution.

>From: "Svenne Nilsson" <svenne979 at hotmail.com>
>To: ode at q12.org
>Subject: [ODE] Controlling a sphere
>Date: Wed, 11 Feb 2004 23:01:09 +0100
>
>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/
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode

_________________________________________________________________
Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/



More information about the ODE mailing list