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 Professional Discussion / Need help with heightmap terrains

Author
Message
mnemonic
18
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 11th Apr 2013 17:57
Trying to get a more understanding about terrain quads, I made a simple example:

step 1: I opened up T.ED, choosed 'new terrain' then Single mesh terrain Large 64x64. Exported it as a heightmap.

step 2: Drew a square shaped image, white with black borders. (This one will later be used as the terrain detail texture.

step 3: Drew another square shaped image, but this time all white (later on used as the terrain texture)

step 4: wrote my little program:


As assumed, the terrain gets very tiled, so you can see all it's quads. I started my player in one corner of the terrain and the walking to the opposite corner. Whilst doing this I counted every quad. My count stopped at 63, even after doing this several times.
Why 63? Shouldn't it be 64?

BEST!

www.memblockgames.com
Brendy boy
19
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 11th Apr 2013 18:25
terrain is divided across and down by 64 lines. That makes up 63 tiles

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Apr 2013 18:32
It starts at 0. So 0 to 63 is 64 quads. (You have to count 0 as the first quad.)

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
mnemonic
18
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 11th Apr 2013 23:46
ah yes. The starting at zero. How stupid of me, now that you're saying it it is so obvious.

www.memblockgames.com
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Apr 2013 00:19
It's easy to forget.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]

Login to post a reply

Server time is: 2025-05-17 18:09:49
Your offset time is: 2025-05-17 18:09:49