Terrain question

Blitz3D Forums/Blitz3D Beginners Area/Terrain question

seferey(Posted 2005) [#1]
I've been learning every piece of code that I can think of

but I don't know how to randomize a terrain

; CreateTerrain Example
; ---------------------

Graphics3D 640,480
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,1,0

light=CreateLight()
RotateEntity light,90,0,0

; Create terrain
terrain=CreateTerrain(256)

; Texture terrain
grass_tex=LoadTexture( "mossyground.bmp" )
EntityTexture terrain,grass_tex



While Not KeyDown( 1 )

If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05

RenderWorld

Text 0,0,"Use cursor keys to move about the terrain"

Flip

Wend

End


seferey(Posted 2005) [#2]
this and the animation code i now understand


Rob Farley(Posted 2005) [#3]
http://www.blitzbasic.com/b3ddocs/command.php?name=ModifyTerrain


seferey(Posted 2005) [#4]
Let see If I'm right a create Plane command makes the ground infinite right so um but can this command be used
on a .b3d file that's been created with terra3d.


xmlspy(Posted 2005) [#5]
Your question is confusing. CreatePlane can always be called. You can put a mesh above or below the plane, if that is what you mean when you say "used on a .b3d file"


seferey(Posted 2005) [#6]
:)


seferey(Posted 2005) [#7]
.


seferey(Posted 2005) [#8]
.


Rob Farley(Posted 2005) [#9]
You're confusing meshes with terrains I think.

To use a blitz terrain you need a grey scale heightmap in a power of 2 size 32x32, 64x64, 128x128 ... 1024x1024, 2048x2048 etc. Blitz terrains use LOD (level of detail) and are rebuilt every frame.

Meshes are static (to a certain extent) and are usually created in 3D modelling software. Some 3D modelling software will allow you to load a greyscale heightmap to create a mesh from that, this could then be saved and loaded into blitz as a mesh, however, you'd lose the LOD.


seferey(Posted 2005) [#10]
.


seferey(Posted 2005) [#11]
How do I load a .B3d file in Blitz3d


GfK(Posted 2005) [#12]
You can't. A .b3d file is not a terrain. A 'terrain' is merely a picture, a heightmap its called. It uses the red element of each pixel to determine the height of the ground. The brighter the colour, the higher the ground. You can draw a heightmap yourself in anything from MS Paint upwards. It has to be square and must be 2^x, so 16x16, 32x32, 256x256 etc.

Unsurprisingly, you use LoadTerrain() to load a terrain. You can then scale it vertically if you want the 'mountains' and 'valleys' to be more pronounced.

Use the edit button. Don't post five times in a row in the same thread. It annoys people.


seferey(Posted 2005) [#13]
.


fraggle(Posted 2005) [#14]
I am examining blitz3d now since 5 hours. I would like to use lod because the terrain has to be really big,so i must use LoadTerrain. I want to give the player the possibility to build streets on the terrain. How can I do that? I normaly would do this task with multitexturing in the moment, the corresponding vertices are drawn. The next possibility would be some textured quads with the vertices with a transparent texture on it alligned with the terrain itself a little higher, but that has some problems in distant streets. As I see it, my only possibility is to write my own ROAM or simillar algo. and extend (which I am hopefully able to) the basic with my own implementation. Any ideas?