chuck
09-07-2006 05:33:07
I'm working on a engine that requires loading static data, and terrain geometry when a page loads. For this I need to know the basic layout of page and tiles. Here's my current understanding if any things wrong here please correct me:
The terrain consists of a number of pages (width, height properties) where
width = (num of pixels of height map width) / page size
height = (num of pixels of height map height) / page size
I know that this isn't exactly the case, take the gcanyon sample for example which has a width of 4097 in this case 4097/513 = 7.98... all I can think of is that the pages must overlap a bit , ie share vertices along the edges, if anyone knows if this is the case then I'd like too know but it's not really too important for pages as I can find out the width and height from the attributes?
Now each page consists of a number of tiles, what I need too know is how too work out how many tiles are in a page ie tile width and height (should be the same as a page is square) and whether if I was too request a tiles vertex data with the "PageGetTileVertexData_2" option, is the tile x, z coordinate relative to the page specified or globally?
I've given it a try at finding the tile width and came up with this formula
Tile Width = (Page Size – 1)/(Tile Size -1)
This assumes that each tile's edges are overlapping with the adjacent tile, ie share the vertices with the tile next too it and seems to work as the result is a nice whole number (8 in the case that page size is 513 and tile size is 65).
Lastly I'm a bit confused about why there are pages and tiles as opposed to having only tiles, is it because the pages are loaded into memory as needed and only the necessary tiles of those pages are rendered which would seem too make sense?
Anyway just too summarize here are my questions
The terrain consists of a number of pages (width, height properties) where
width = (num of pixels of height map width) / page size
height = (num of pixels of height map height) / page size
I know that this isn't exactly the case, take the gcanyon sample for example which has a width of 4097 in this case 4097/513 = 7.98... all I can think of is that the pages must overlap a bit , ie share vertices along the edges, if anyone knows if this is the case then I'd like too know but it's not really too important for pages as I can find out the width and height from the attributes?
Now each page consists of a number of tiles, what I need too know is how too work out how many tiles are in a page ie tile width and height (should be the same as a page is square) and whether if I was too request a tiles vertex data with the "PageGetTileVertexData_2" option, is the tile x, z coordinate relative to the page specified or globally?
I've given it a try at finding the tile width and came up with this formula
Tile Width = (Page Size – 1)/(Tile Size -1)
This assumes that each tile's edges are overlapping with the adjacent tile, ie share the vertices with the tile next too it and seems to work as the result is a nice whole number (8 in the case that page size is 513 and tile size is 65).
Lastly I'm a bit confused about why there are pages and tiles as opposed to having only tiles, is it because the pages are loaded into memory as needed and only the necessary tiles of those pages are rendered which would seem too make sense?
Anyway just too summarize here are my questions
1. Does what I've said above sound correct?
2. Is the formula for calculating the 'tile width' correct?
3. Is the x, z tile coordinates for the "PageGetTileVertexData_2" option relative to the specified page or global?
4. Is it best to load (from disk) the static geometry for the scene every time a page is loaded or every time a tile is loaded and unloaded when the page is discarded?
[/list:u]
Thanx in advance,
Charles