Two ways of turning a car
What is the normal/best way of turning a car ?
I have a car in 3d Space which has a common 3x4matrix for rotation/translation.
First I thought I rotate the cars up/down axis to turn the car and then rotate the velocity vector with the rotationmatrix so that it always points in the foreward direction of the car.
Then I saw this approach where you calculate the center of the circle the car turns around from a given "steering angle" and rotate the car around a point which lies outeside of the body of the car.
Which one do you use/would you prefer
(the car ist a derivative of a general physics object class)
thanx
Lukas Henschke
The actual circle of turning depends on where the front wheels are facing. I don''t know the calculation, but you might want to come up with a formula for the center and turn radius, and do it that way. (The second option you mentioned)
I think it helps the player suspend their disbelief when they feel like they are controlling something that behaves like an actual car.
If it''s a sci-fi vehicle or something clearly fictional, turning on the vehicle''s center might be ok. It will be up to the player to figure out how the vehicle handles and adjust their steering accordingly.
I think it helps the player suspend their disbelief when they feel like they are controlling something that behaves like an actual car.
If it''s a sci-fi vehicle or something clearly fictional, turning on the vehicle''s center might be ok. It will be up to the player to figure out how the vehicle handles and adjust their steering accordingly.
It's not what you're taught, it's what you learn.
I would recommend using correct physics as far as possible, then adding a fudge to make it behave realistically. I would rotate the car, then reduce the velocity along the direction perpendicular to the direction the car is travelling. If the turn is small and therefore the perpendicular component small, then the car will travel in the direction it''s pointing. If the component is large enough then the car will skid.
That''s as far as I would go without taking into account the individual wheels. I wouldn''t recommend turning the car about a point with a given radius. That is and would look very unrealistic.
That''s as far as I would go without taking into account the individual wheels. I wouldn''t recommend turning the car about a point with a given radius. That is and would look very unrealistic.
You should turn the car from around a point from the outside of the car.
ex1. (the graph is supposed to look like a wheel)
ex2.
in this example(ex2) the car wheel has rotated. And if you look at the vector you can see that it's pointing somewhere, and if the car would be turning this way long enough it would eventually
have drived round a circle. Even if you just turn a couple of degrees, the car will eventually make a whole circle.
So use a vector!
However if we were going to be totally realistic we would also have to take the other wheel in the count. However that would prolly be overwork.. oh, and the wheel you should have this vector on should be the one facing the the direction the car is turning, so if you are turning right you should use the vector on the right wheel and if you are turning left you should use the vector on the left wheel..
Another example just to illustrate my point:>
oke, my bad english and this ascii art might not have been such a good idea to explain these kind of things...
I think it says something about this in one of the tutorials about car physics in gamedev...
hmm... doesnt almost all car games do this?(turn around a orgin outside the car that is)...
[edited by - pag on May 14, 2003 5:52:55 PM]
ex1. (the graph is supposed to look like a wheel)
|---| vector(inifinite radius(so it goes straight forward)) |---| ---------------> |---| |---|
ex2.
|---| |---| v |---| ---- |---| ----> O <- origin of the circle
in this example(ex2) the car wheel has rotated. And if you look at the vector you can see that it's pointing somewhere, and if the car would be turning this way long enough it would eventually
have drived round a circle. Even if you just turn a couple of degrees, the car will eventually make a whole circle.
So use a vector!
However if we were going to be totally realistic we would also have to take the other wheel in the count. However that would prolly be overwork.. oh, and the wheel you should have this vector on should be the one facing the the direction the car is turning, so if you are turning right you should use the vector on the right wheel and if you are turning left you should use the vector on the left wheel..
Another example just to illustrate my point:>
... . o . ... o = origin of circle . = the path the car takes when it has its wheel turned in the same degree the whole time. As you see the car will finally make a whole circle..
oke, my bad english and this ascii art might not have been such a good idea to explain these kind of things...
I think it says something about this in one of the tutorials about car physics in gamedev...
quote:
That's as far as I would go without taking into account the individual wheels. I wouldn't recommend turning the car about a point with a given radius. That is and would look very unrealistic.
hmm... doesnt almost all car games do this?(turn around a orgin outside the car that is)...
[edited by - pag on May 14, 2003 5:52:55 PM]
I am a signature virus. Please add me to your signature so that I may multiply.
Physics of Racing Series is a 26 part series about just that.
[How To Ask Questions|STL Programmer''s Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
[How To Ask Questions|STL Programmer''s Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
Arguing on the internet is like running in the Special Olympics: Even if you win, you're still retarded.[How To Ask Questions|STL Programmer's Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
I would say:
Physics of Racing Series is a 29 part series about just that.
Did I win something now? My link = 29 parts...
[edited by - freeman_swe on May 17, 2003 1:39:23 PM]
Physics of Racing Series is a 29 part series about just that.
Did I win something now? My link = 29 parts...

[edited by - freeman_swe on May 17, 2003 1:39:23 PM]
quote:
Original post by freeman_swe
Physics of Racing Series is a 29 part series about just that.
Oh darn, you beat me with 3 parts. This is why mirrors suck if they aren''t updated.
[How To Ask Questions|STL Programmer''s Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
Arguing on the internet is like running in the Special Olympics: Even if you win, you're still retarded.[How To Ask Questions|STL Programmer's Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement