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 / Strange Advanced Terrain Sizes

Author
Message
GrumpyOne
18
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 24th Sep 2010 12:32
Hi All,

I've found something weird about advanced terrain. I am creating a terrain using a 512x256 heightmap. I expected it to produce an object with 511 quads along one side, and 255 quads along the other, assuming that each pixel is used for one vertex. It doesn't it generates an object 255 quads by 446 quads.....It took me ages to figure out why the coordinates I was calculating didn't match the vertex coordinates.

The good news is that the quads are perfectly square, so I can calculate the coordinates as long as the smaller dimension remains the same as the number of pixels....but is their a function to return the number of vertexes in a terrain? I am guessing lock it and get the vertexdata?

Perhaps the reason for the bizareness is I am using a jpeg for the heightmap? Has anyone noticed this with bmps?

Best,
Mr Grumpy

GrumpyOne - the natural state of the programmer
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Sep 2010 12:40
Yes, AT does have some weird features - one of the reasons I stick to square power of two heightmaps. In my own terrains I use any values I think are convenient. I'm baffled why AT was implemented like this.

Quote: "I am guessing lock it and get the vertexdata?"


Yes - but find out how many limbs there are first using perform checklist for object limbs as in the following snippet from the help file. It'll save a lot of agony later.

GrumpyOne
18
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 17th Oct 2010 11:49
Thanks GG, I'm glad it wasn't just me doing something wrong!

GrumpyOne - the natural state of the programmer

Login to post a reply

Server time is: 2026-07-22 12:41:21
Your offset time is: 2026-07-22 12:41:21