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.

Newcomers DBPro Corner / slanting up hills

Author
Message
Rahil45
16
Years of Service
User Offline
Joined: 31st Jul 2008
Location:
Posted: 24th Sep 2008 08:47
Hi. I've just finished a basic code of a car driving around a flat surface, but i want to know how to make a hill or something and make it slant as it goes up the hill. Any ideas anyone? If it incudes using a matrix, could someone point me to some tutorials or something?
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 24th Sep 2008 14:28
Well, if you store your previous positions you could do this to determine the angle of inclination:

If that was your question?

To make a hill, search for terrain editors, do it in your favourite modelling program or, if you wish it simple, use a matrix (but they're rather outdated by now).
Ah, that's right, another really simple thing - use the advanced terrain plugin (search for info on it; it's included with DBPro).

"I kören hörs de brummande busarna Björnligan och Gondolen"
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 24th Sep 2008 18:21
That code snippet will return the azimuth angle. He presumably wants the altitude angle:

incl# = atan((posy#-oldposy#)/sqrt((posx#-oldposx#)*(posx#-oldposx#)+(posz#-oldposz#)*(posz#-oldposz#)))

The optomist's right, The pessimist's right.
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 24th Sep 2008 20:57
here's a basic example:

Login to post a reply

Server time is: 2024-09-27 20:24:27
Your offset time is: 2024-09-27 20:24:27