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 / Getting height from two matrixes?

Author
Message
jobromedia
11
Years of Service
User Offline
Joined: 9th May 2012
Location: Stockholm, Sweden
Posted: 10th May 2012 09:02
So this is the deal. As a beginner in DBPro I'm maybe doing this the wrong way. And possibly this question has arisen many times before. I've googled, and found part of the answer I seek. Can you guys help me out? I hope so.

I'm using 2 matrixes, for now at least, to generate the landscape. What I would like to know is: How do you determine on what matrix one's walking. I got one for grass, and the other for mountains.

Is this information enough? I hope so. Anyways thanks in advance for any help given.

Best regards
Johan Brodd
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 10th May 2012 15:43
Do the matrices intersect or are they next to each other?
If they intersect then take the highest ground height. If next to each other then switch which matrix you test based on x/z co-ordinates.

WARNING: The above comment may contain sarcasm.
jobromedia
11
Years of Service
User Offline
Joined: 9th May 2012
Location: Stockholm, Sweden
Posted: 10th May 2012 23:30
Well the matrices is stacked atop of each other like a regular sandwich. Atop is the grass matrix that has parts from a mountain matrix raised from beneath it.

Best regards
Johan Brodd
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th May 2012 15:06
Like OBese said, take the heights of both at the same point and then use the higher value.

GET GROUND HEIGHT etc.

Taking the two matrices, grass=1 and mountain=2 for instance, you can figure out which matrix you are in contact with after your test.

Test matrix 1 and get the ground height from that.
Test Matrix 2 and get the ground height from that.

If height1 > height2 then you are on the grass.

Make sense?

Enjoy your day.

Login to post a reply

Server time is: 2024-03-29 14:55:08
Your offset time is: 2024-03-29 14:55:08