View Full Version : Turning a car...
08-31-2008, 01:58 PM
I need to think a way to do a car (actually a truck) to be driven. I need to find a way if I turn the wheels, the car must follow the path correctly. I'm struggling a lot to think in a way that I can do that properly, I googled but I can't find anything. Someone can help me or even know a tutorial/example of how to do this? can be a simpler manner, I don't need the Y coordinate (the car won't fly), only Z and X.
08-31-2008, 03:11 PM
This is more a math topic. Anyway.
Imagine the car has only one front-left weel and one rear-left wheel, it is easier.
At anytime, the rotation of the car will depend :
- of the speed of the car,
- along an arc,
- which is defined by its center (virtual intersection of rear and front wheel axis) and its radius (distance from this intersection to the rear wheel).
This is secondary education trigonometrics.
08-31-2008, 03:30 PM
How can I find the intersection point mathematically?
08-31-2008, 05:06 PM
I'm thinking in finding the point and translate it to the origin (0,0,0) and then, rotate the modelview matrix around Y axis, and then, translate it again to the original location. But I need to know constantly where is the intersection point.
To find the intersection point will be a [censored], how can I track the point with a function if the wheel axis is moving around?
It must be an easier way.
Well, I give up... :(
08-31-2008, 05:19 PM
Please, I implore, help me, I need to do that still this week. :(
Dude, sorry to appear rude, but this is the wrong forum for such questions. Try gamedev.net or devmaster.net.
09-02-2008, 11:02 AM
you may build two planes. The 1st with a normal that is the front wheel forward direction and a point that is the front wheel center. The 2nd with the rear wheel forward direction center.
Then it possible to find the planes intersection which is a line. With the line equation:
x = ay + b
z = cy + d
y = K (a constant)
you choose y value as the wheel height from the floor and you obtain x and z values at the intersection point.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.