PDA

View Full Version : Get Car Rotation on Terrain ?!



MofuX
12-20-2001, 01:19 AM
hi, i have got an terrain and want to get a car driving on it. I have calculated 4 Points which represents the 4 wheels in x,z coordinate. The y-value is the height of the terrain in the point(x,z).

so now i have got:

frontleft x,y,z
frontright x,y,z
backleft x,y,z
backright x,y,z

now i need the rotation axis of car, represents by the heightvalues of my 4 points. But how can i get my x and z rotation? (the y-rotation is the direction angle of the car)

could somebody write down the maths i need for that?

ah, if you something dont understand take a look on my newest Terrain and Console Demo @
/*general site*/ www.mofux.de.vu (http://www.mofux.de.vu) www.spicken.de/mofux (http://www.spicken.de/mofux)
/*Download link*/ http://www.spicken.de/mofux/demos/demo1612-01.zip

thanks, your MofuX!




[This message has been edited by MofuX (edited 12-20-2001).]

chxfryer
12-20-2001, 04:44 PM
I too am looking for realistic automotive physics. By realistic I mean taking in account hp, torque, gear ratios, suspension and what not. YES I know this is NOT on topic but I didn't start the thread. Just a link would be nice. Thanks a lot.

rIO
12-21-2001, 02:48 AM
torcs.sourceforge.net a good good start.

and also give a look on gamasutra and gamedev.net for some interesting articles on drivign game physics.

hope this helps...

Jambolo
12-21-2001, 12:45 PM
Decide which 3 of the four wheels are on the ground, then compute the normal to the plane formed by these three points.

Lev
12-21-2001, 02:26 PM
Check this out:
http://members.home.net/rck/phor/

-Lev

MofuX
12-24-2001, 01:21 AM
yes mates, i've got it... who is interested:

first calculate the high of your 4 wheels!

across=((frontrighth-frontlefth)+(backrighth-backlefth))/2.0f;

length=((backlefth-frontlefth)+(backrighth-frontrighth))/2.0f;

so you get the x and z rotation.... thats all http://www.opengl.org/discussion_boards/ubb/wink.gif