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 / DBPro - Matrix grid Issues with Get Ground Height()

Author
Message
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 12th Feb 2011 09:16
hello
Ive made a program with a 10 by 10 grid of randomized matrices and i want to walk the camera over it.
I\'ve written this code...



...to find the current matrix the camera is over, and it seems to display the correct matrix number.

however when I try to Use the Get ground height() command
It doesnt seem to respond correctly, it seems like its taking the ground height from another matrix and nothing I do seems to fix it.

here is the entire program to run and see







Can anyone see what I am doing wronge?

Is there an easier way to determine which matrix my camera is moving over?

thankyou

kezzla

Sometimes I like to use words out of contents
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 12th Feb 2011 14:59
I can't get anything to even show up (made my own grass4.jpg texture). Also, you are using the reserved keyword, MAX, in your code. I changed the max variable and got it to run. After several seconds, it prints some values on the left side of the screen, but it is blank.

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 12th Feb 2011 15:21
ok, this is extremely strange, this code worked when I pasted it in here, now Its screwing up on mine too. Its late and im gonna sleep before I try and Figure this one out.
It has to have something to do with a failed post attempt,(my default case statement was a curse on computers containing swear words before i changed it, since then extra / slashes have been added + something else im missing, ill get the code sorted and repost, sorry for the screw around.

kezzla

Sometimes I like to use words out of contents
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 12th Feb 2011 21:05
Hi there.

Quote: "I changed the max variable and got it to run"


I made the same as LBFN with the variable name, plus I had to rem all print lines and got it work, but strange as you said "kezzla", but what I donĀ“t understand , is the purpose of doing that with several matrices...is it perhaps faster than just one ? . Surely this is not your case, and you know how to do it with a unique matrix .

Cheers.

I'm not a grumpy grandpa
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 13th Feb 2011 03:45
Thankyou LBFN,
I have fixed the max variable and removed the print commands so it will run properly.

thankyou too Chafari.
This Matrix grid system is a study I'm playing with in an attempt to find the easiest way to generate random terrain with different height ranges. The idea is that i can randomly choose matrices to be different types of terrain eg. Mountains, plains, gentle hills etc. eventually I would like to use tiles as beaches, rivers, lakes and any other terrain feature I add into the generator.

I thought that this method may be an easy way of achieving this goal, however this camera issue is bothersome, and i've still got some gremlins in the terrain joining subroutine.

maybe I will go back to one matrix and use another smaller matrix to get the height values for my "terrain Blocks" and then assign the height values to a section of the large matrix. That may be better and will definitly fix the matrix selection issue.

I still wonder if there is a "detect matrix via collision" style command I haven't found that makes the process simpler.

Thanks again guys
kezzla

Sometimes I like to use words out of contents
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Feb 2011 16:58
@kezzla

It's good to investigate and learn, but I think a big matrix covering the size of 10 matrices, it is faster than 10 matrices. In this matrix giant, you could vary the texture, to achieve different types of terrain

Good luck !

Cheers.

I'm not a grumpy grandpa
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 13th Feb 2011 20:34 Edited at: 13th Feb 2011 20:37
Kezzla,

I would suggest you consider using a terrain instead of multiple matrices. Granted, terrains have issues, but it might be an alternative worth considering. I personally use Advanced Terrain:
http://forum.thegamecreators.com/?m=forum_view&t=38692&b=18

There is a sticky for BlitzWerks terrain on the DBPro board.
http://forum.thegamecreators.com/?m=forum_view&t=181060&b=1

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 14th Feb 2011 12:05
Thanks guys,

I will eventually move on to using terrains, Ive looked at a little code for randomly generating height maps and saving them as an image, it is still over my head at the moment.
my matrix work is a case of learning to walk before trying to run.

Thank you both for your help and suggestions.
kezzla

Sometimes I like to use words out of contents

Login to post a reply

Server time is: 2024-09-29 02:34:09
Your offset time is: 2024-09-29 02:34:09