terrain help?

Blitz3D Forums/Blitz3D Programming/terrain help?

lecks(Posted 2003) [#1]
in the help for ModifyTerrain() it says Height# should be in the range 0-1.
how can i set the height in 3d space? i need it to range from -1000 to 1000 at least, surely terrains arent limited to 0-1 in 3d space? atm i'm using this:
[CODE]
for counter = 0 to 128
ModifyTerrain(terrainentitys(section), counter, z, y#)
counter = counter - 1
Wend
[/CODE]
z is the current z (or y) position on the terrain, y# is the height i want the points to be at.
it seems to do nothing atm.


fredborg(Posted 2003) [#2]
You need to scale your terrain on the y axis, to make the height variation greater. The height value going in to ModifyTerrain needs to be in the range 0-1, but if you scale your terrain with ScaleEntity terrain,1,1000,1 then they will effectively be in the range of 0-1000. Simple as that.

Fredborg


lecks(Posted 2003) [#3]
so to set the height in real time, as im moving along the terrain with the camera, i'd have to scale the terrain down, set the height of the points, then scale it up again?

or do i divide the camera height by 1000? so its between 0 and 1, while the y scale of the terrain is 1000?

sorry im new to this type of terrain


fredborg(Posted 2003) [#4]
No, no, no need to scale up and down. If you want to use values between 0-1000 then simply divide by 1000 when setting the height of the terrain...
ModifyTerrain terrain,grid_x,grid_z,0.5
Is the same as
ModifyTerrain terrain,grid_x,grid_z,500/1000.0
Just remember to divide by 1000 every time...

Fredborg


lecks(Posted 2003) [#5]
hmm ok, so i'm guessing theres no way of moving a point to the height of an objects position, or moving it to under 0 in 3d space (without using complicated maths).