Deforming Terrain: a few beginner's questions

LR

29-08-2007 16:55:58

Hi there!

I'm about to write the code for a sim-city like game (don't know how this genre is called in English :oops: ). To achieve nice rolling terrain I decided to use the PLSM, even though it might be a bit big for my project since paging is not what I really need, as the playfields will be relatively small and confined. But it seems there is no other scene manager available that supports real time deformations of the heightmap.

... and here are my newbish questions:

1. This code is used to generate the brush for flattening the terrain around an arbitrary point:
mSceneMgr->setOption( "fillBrushArray", &Center );
for( int a=0; a<64; a++ )
for( int b=0; b<64; b++ )
deltaArray[a+b*64] = ( Center.y/513000.0 - deltaArray[a+b*64] );

Where Center is a point on the terrain returned by a RaySceneQuery.
I found the scaling factor of 513000 by try and error... is my assumption correct that this is 100x the terrain's Y-scale?

2. The *.modif.png files for the heightmap are saved at the same location as the paging data. Is there a way to specify another location, so to separate save games from level data?

3. When applying the brush with mSceneMgr->setOption( "DeformationCenter", &Center ); the application freezes for a short moment. Can this be improved?

4. Is there a way to have holes in the terrain, e.g. removing single tiles to improve rendering speed where the terrain is fully covered with buildings?


Thanks in advance for help and answers.