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 / "get ground height" question

Author
Message
marc
21
Years of Service
User Offline
Joined: 5th Nov 2003
Location:
Posted: 9th Nov 2003 19:49 Edited at: 10th Nov 2003 16:12
Another newbee question:

I'm trying to use the "get ground height" command to apply gravity to an object. (Using matrixes, off course)

I'm using these variables:

ox# = object position x (1)
oy# = object position y (1)
oz# = object position z (1)
gh# = get ground height (1, ox#,oz#)

Then I'm using the gh# variable to set the object y position. But the return value of gh# doesn't seem to be the actual ground height at the object 1 x and z coordinate. What I am doing wrong? can anyone tell me how to make my code work properly?

P.S. I'm using DBpro

M.-A. Mageau
Port-Cartier, Québec
Canada
marc
21
Years of Service
User Offline
Joined: 5th Nov 2003
Location:
Posted: 10th Nov 2003 01:57
I tried with "get terrain height" and it seems to work fine... I'm doing something like this:

...
do
ox# = object position x (obj)
oz# = object position z (obj)
oy# = object position y (obj)
th# = get terrain height

if upkey() =1 then position object ox# + 1, oy#, oz# +1
if oy# > th# then move object down obj, 1
if oy# < th# then position object obj, ox#,th#,oz#

loop

How can I code something similar using matrixes? I tried almost everything and it is still not working...

M.-A. Mageau
Port-Cartier, Québec
Canada

Login to post a reply

Server time is: 2024-11-25 16:38:22
Your offset time is: 2024-11-25 16:38:22