[help] Scaling Terrain

kungfoomasta

04-11-2006 18:23:24

I'm trying to allow users to scale the terrain, but the set/get options don't match up.

To query for the terrain scale, I call:

// populate mTerainScale with original terrain dimensions
mSceneManager->getOption("Scale",&(mTerrainScale));


But there is no setOption("Scale",...);
Instead, there is a "WorldDimension" option, but this takes a Vector2 object:

if (strKey == "WorldDimension")
{
Vector2 dim = * static_cast < const Vector2 * > (pValue);
world_height = static_cast < unsigned int > (dim.x);
world_width = static_cast < unsigned int > (dim.y);
#ifndef _MAPSPLITTER
#ifndef _MAPEDITOR
assert (primaryCamera);
static_cast <PagingLandScapeSceneManager *> (primaryCamera->getSceneManager())->WorldDimensionChange();
#endif //_MAPEDITOR
#endif //_MAPSPLITTER
return true;
}


Can we make a setOption("Scale",...) option to match getOption("Scale",...), and make this function able to modify all 3 dimensions independantly? (WorldDimension only accepts a height and width, which I guess re-uses width for depth). Make sure this function calls the correct function to update the terrain dimensions, I guess this is "WorldDimensionChange(...)".

KungFooMasta



Also, setOption("Width",...) and setOption("Height",...) take unsigned int values.. shouldn't this be unsigned Real values?

tuan kuranes

05-11-2006 13:34:07

dimension is number of pagex and page z
scale is terrain scale, not modifiable at run-time...

kungfoomasta

06-11-2006 02:41:41

Ok, well thanks for input :)

Moving on!

KungFooMasta

nindim

13-03-2007 16:35:20

Sorry to bring up an old thread, but couldnt you just apply a brush the size of your entire map all with the same values in array that would scale your map for you? Might be slow but it would work.

kungfoomasta

13-03-2007 18:33:19

Deformation only moves the terrain up or down, right? That's not the same as making a mountain *bigger*, in height/width/depth dimensions.

The best way would be to alter the cfg file's dimensions and reload the terrain. Scaling shouldn't happen that often then, as you'd need to reload the terrain many times to get decent feedback.

KungFooMasta

nindim

14-03-2007 03:54:07

Ah, you wanted to do x and z scaling as well. Guess that wouldnt work then, thinking about it even scaling in the y direction would invlove building a brush relative to all the points in the map and then applying. A costly procedure.