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 / matrix tile number?

Author
Message
Jurgen
23
Years of Service
User Offline
Joined: 3rd Mar 2003
Location:
Posted: 12th Aug 2003 14:06 Edited at: 12th Aug 2003 14:41
okay, how do I walk on a randomized matrix? I need to be on top of it, not flying right trough it, your character in the game can't just fly through ground.... I tried to use the get ground height command and it gave some pretty unexpected results, so now I'm willing to use get matrix height command, but then it wants to know which tile, well the tiles were I'm walking on stupid PC

If anyone else knows of a way to simply code a way of walking on TOP of a randomized matrix plz tell me. <- Please include ALL of the coding, you know it starts with: make matrix 1, .... etc.

thank you

"Only when all the seas are poisened, only when all the trees have been cut only when all the animals are killed, people will understand that money can't be eaten..."
zao420
22
Years of Service
User Offline
Joined: 5th Aug 2003
Location: Canada
Posted: 12th Aug 2003 15:12
o made that real quick and its a bit sloopy but i think it should help you out..
Attreid
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 12th Aug 2003 15:14
I don't understand why you want to use get matrix height instead of get ground height ... it's maybe because you weren't positionning the camera a few meters/centimeters/feet/inchs/.. above the matrix
here's a code that work well

"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
Jurgen
23
Years of Service
User Offline
Joined: 3rd Mar 2003
Location:
Posted: 13th Aug 2003 17:09 Edited at: 13th Aug 2003 17:52
I'm very sorry to tell you guys that I keep shifting height as I walk :S very strange... but my height is not the height of the matrix... sugestions?

"Only when all the seas are poisened, only when all the trees have been cut only when all the animals are killed, people will understand that money can't be eaten..."
Attreid
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 13th Aug 2003 18:09
have you the last update of db ?
and .. is it DBC or DBP ?

"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 13th Aug 2003 18:31
what code are you using? make sure you use update matrix afetr changing the height of your matrix!

I have a website!!!
So go there: http://www.freewebs.com/darkb/index.htm
on second thought you probably shouldn't
Jurgen
23
Years of Service
User Offline
Joined: 3rd Mar 2003
Location:
Posted: 13th Aug 2003 18:52 Edited at: 13th Aug 2003 19:00

hide mouse

make matrix 1,200,200,10,10
randomize matrix 1,15
update matrix 1
load image "grass.bmp",1
prepare matrix texture 1,1,1,1

do
xrotate camera wrapvalue(camera angle x()+mousemovey())
yrotate camera wrapvalue(camera angle y()+mousemovex())

ox#=camera position x(0)
oy#=camera position y(0)
oz#=camera position z(0)
position camera 0,ox#,get ground height(1,ox#,oz#)/10+3,oz#

if upkey()=1 then move camera 0,0.1
if downkey()=1 then move camera 0,0.1
loop


This is the code I'm using... And I can understand you're getting mad (I for one am going to )

and this is the result after I compiled it:

http://www.geocities.com/jurgen182/Test.zip

When you run it, you'll see my point I hope...

"Only when all the seas are poisened, only when all the trees have been cut only when all the animals are killed, people will understand that money can't be eaten..."
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 14th Aug 2003 02:44
Well, pretty simple to solve. Why the hell are you dividing height by 10?

Just get the height and add whatever height you want camera to be above matrix.

e.g. position camera 0,ox#,get ground height(1,ox#,oz#)+10,oz#

The programmer formerly known as sonic
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Aug 2003 06:32
As you are using Camera 0, you must be using DB Pro.

Get Ground Height returns the height of the matrix at any given X and Z co-ordinate, whereas Get Matrix Height returns the height of the matrix at a given matrix tile intersection - that's why it asks for the matrix tile number.

To use Get Matrix Height, all you need to do is divide the current camera X and Z co-ordinates both by the matrix tile width and height - which in turn depends on the number of X & Z segments and matrix width and height used in the Make Matrix command when you created the matrix.

If you are using patch U5, there's a bug in it (now fixed for the final release) which returns a negative value for Get Ground Height.

If your character goes down instead of up when you reach a hill, you simply use the work-around:


Gh#=0-(get ground height(1,ox#,oz#)/10+3)
position camera 0,ox#,Gh#,oz#


TDK

Login to post a reply

Server time is: 2026-07-06 10:32:59
Your offset time is: 2026-07-06 10:32:59