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 / Walking from on matrix to another

Author
Message
Karz
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Netherlands
Posted: 29th Apr 2003 16:52
Hi there, I am a rooky on programming and got stuck whit my first person shooter. I have 4 matrices next to eachother blending perfectly well to eachother (I mean there are no holes at the edges of the matrices). Now I would like t walk from one matrix to another, but when I reach the edge, the camera just ignores the other matrices and falls under it and stays walking on the air. It is caused by the command of camera position:

Y# = Get ground height(1,X#,Z#)
Position Camera X#,Y#+50,Z#

'Get ground height' only works with matrix 1 and not with the others. What to do? I'm sure the solution is not that difficult, I just can't find it. I thank you in advance.
One must keep his friends close,
but his enemies even closer. -The Godfather
Cras
21
Years of Service
User Offline
Joined: 15th Oct 2002
Location: United Kingdom
Posted: 29th Apr 2003 17:51
ok ive never done this but it cant be that hard.

Y# = Get ground height(1,X#,Z#)

this bit here, the one is stating that you should get the ground height of matrix 1. change this to the variable: currmat

now lets say each of your matrixes are 500 by 500 squares. you want a way to work out which matrix you are over.

tsay this is the arrangement of the matrixes:

|3|4|
|1|2|

if yours is different chage the numbers on this bit:

if camera position x() < 501 and camera position z() < 501 then currmat = 1
if camera position x() > 500 and camera position z() < 501 then currmat = 2
if camera position x() < 501 and camera position y() > 500 then currmat = 3
if camera position x() > 500 and camera position y() > 500 then currmat = 4

hope that helps
Karz
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Netherlands
Posted: 4th May 2003 18:48
well, hey... It does. Thanks for your help. Now I can add some variation to my landscapes

One must keep his friends close,
but his enemies even closer. -The Godfather

Login to post a reply

Server time is: 2024-09-20 07:58:17
Your offset time is: 2024-09-20 07:58:17