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.

DarkBASIC Discussion / Matrix problem

Author
Message
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 2nd Aug 2003 08:38
I was trying to load 2 matrix types you know Make Matrix 1 then make matrix 2 yeah well anyhow i got both matrixes to show up but i can still only walk on one oncei reach the end of one matrix and try to get on the other i guess its the bounding box or whatever stops me from crossing over =\

Anyone got some code to help me with this or maybe some tips?
Ag3ntSm1th
22
Years of Service
User Offline
Joined: 13th May 2003
Location:
Posted: 2nd Aug 2003 08:56
alls you need to do is test which matrix you are standing on at any given moment, then set player height to get ground height(tested,px,pz).

"The secret to creativity is knowing how to hide your sources." - Einstein
my DarkBasic creations - http://www.sixurbanninjas.tk
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 2nd Aug 2003 09:26
Probably should have mentioned 2 things im a noobler thats a big one and the second im using DB1.13 guess thats DBC since it isent DBP heh so make me understand what
height(tested,px,pz).

is

Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 2nd Aug 2003 09:51
Look up the GET GROUND HEIGHT() function - F1 looks up the function your cursor is over, in case you didn't know.

UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 2nd Aug 2003 18:49
HAHA yeah i saw that in the list of commands wondered if thats what agentsmith ment heh but wasent sure im new to darkbasic but since its taken from C/C++ i should learn quickly =) thanks for your help

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Aug 2003 07:10
Get Ground Height ONLY works for matrices which are located at 0,0,0 in 3D space. If you have a second matrix, then it is probably at another location so when you walk on the second one Get Ground Height stops working - even if you use the correct matrix number in the command.

So, not only do you need to find out what number matrix you are walking on, but you must also compensate for the X and Z offsets you moved any matrix not at 0,0,0.

It gets a little complicated, but if you want to know how it's done, the best way is to look at the Multi-Matrix demo which comes with MatEdit.

It also includes some useful matrix functions which return what matrices are above and below you at any given point in space and which one you are currently walking on.

TDK
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 7th Aug 2003 04:26
uhh crap i can't find matedit but i already got someone to help me he gave me some code which worked for up to 3 matrixes but i still had one problem after the 4th matrix the screen would go black....im trying to make a big world here comon!

http://www.freewebs.com/independant
Ag3ntSm1th
22
Years of Service
User Offline
Joined: 13th May 2003
Location:
Posted: 7th Aug 2003 06:38
try this...


with this, i made 10000 matricies (100x100) but it took like 20 min. and comsumed all of my RAM (512M) and almost all of my VRAM (512M).
as far as the get ground height part goes, you have 2 choices:
1)make a conditional statement for each matrix, relsulting in a LOT of typing, or
2)get clever and make an algorithm to detect which matrix you are in out of all the matricies, and place yourself accordingly.

good luck

"The secret to creativity is knowing how to hide your sources." - Einstein
my DarkBasic creations - http://www.sixurbanninjas.tk
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 7th Aug 2003 09:34 Edited at: 7th Aug 2003 09:36
EDIT: oops i mustve clicked post reply 1/2 way through

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 7th Aug 2003 09:34
heres a method you could use using a simple function i wrote for my game. im not quite sure if it works, but theoretically it should . i only have multiple matrices going along z, not x.



this is asuming your first matrix starts at 0,0 and that they are placed like this:


I'm also not sure if get ground height positions are reletive to the matrix you're on, so if they are, you could add this:


sorry for not being able to test it, i dont have DB on atm

UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 7th Aug 2003 09:54
sorrie guys but since then i'v found a code that will let me make huge landscapes its pretty cool actually it came with matedit those codes in there work good but i have yet to try them with my game heh

but thanks anyways

http://www.freewebs.com/independant

Login to post a reply

Server time is: 2025-05-19 22:54:31
Your offset time is: 2025-05-19 22:54:31