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.

3 Dimensional Chat / 3d collision

Author
Message
super skull
22
Years of Service
User Offline
Joined: 16th Jun 2004
Location: usa
Posted: 17th Nov 2004 07:35
i am going to make a game were you drive a car on a 3d land scape and i want to know how to keep the car on the land scape and not go through.
Zone Chicken
22
Years of Service
User Offline
Joined: 25th Jan 2004
Location: `~-..-~`~-..-~`
Posted: 17th Nov 2004 08:07 Edited at: 17th Nov 2004 08:08
This should be in another area or you should people what your using to write the game (dbc dbp) and such. You could make your land as a matrix or a terrain, and use get ground height or get terrain height returning the y position on the land and update your cars y position with that, that would move your car up and down on the terrain however you'll also need to work in angles for your car so your car will rotate as it moves up and down instead of just rising up flat. You could do this with a hidden object in front of the car with its y also as the return number from the get ground height or get terrain height command and two statements to check if the hidden object is higher or lower then the car on the terrain to know if the cars angle needs to be changed. It wouldn't be perfect but its the easiest way of doing it.

if hidden objects y > cars y then angle car 22
if hidden objects y < cars y then angle car -22

Login to post a reply

Server time is: 2026-07-10 10:41:32
Your offset time is: 2026-07-10 10:41:32