Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Rants
22
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 14th Sep 2003 20:29
I've built a car program, everything seems ok, but I cant figure out how to calc. if its going up hill or down and then the proper rotation. Any help would be appreciated.
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Sep 2003 21:35 Edited at: 14th Sep 2003 21:37
you could get the ground height at the corners of the car, divide the height distance by the distance between the wheels you are checking, then find the ASIN of that, that gives you the angle to tilt, obviously you can get two sets of numbers, front to back right and front to back left as well as left to right for front and back, tilt the car to either the higher, lower, or the average, that works for modest undulations, or on rougher ground you may want to be getting the angles across the diagonals and then tilting the car to a compound of those angles, not sure of the exact sequence though, never made a car game, cheers.

Mentor.
Rants
22
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 14th Sep 2003 21:39
Cool.. You wouldnt happen to have any sample code that would show that?
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 15th Sep 2003 22:11
What I do to work out whether we're sloping up or down is to position a object just infront of the car on the matris and take the difference in heights between me and the dummy object.

If the dummy's Y is smaller then you're going down, else you're going up

c:/dos
c:/dos run
run dos run
Robin
23
Years of Service
User Offline
Joined: 22nd Feb 2003
Location: United Kingdom
Posted: 16th Sep 2003 16:50
binary moons limit rush tutorials has an example of objects tilting to the ground, as does the 'Tank' demo in DBC
Robin

http://www.thegameszone.tk
[email protected]

Login to post a reply

Server time is: 2026-07-26 05:02:51
Your offset time is: 2026-07-26 05:02:51