home *** CD-ROM | disk | FTP | other *** search
- ;demo09-04.bb - Beginning a terrain
- ; ------------------
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- Const ESC_KEY = 1
- Const LEFT_KEY = 203
- Const RIGHT_KEY = 205
- Const UP_KEY = 200
- Const DOWN_KEY = 208
-
- ; Create camera
- camera=CreateCamera()
- PositionEntity camera,0,1,0
-
- ; Create a light
- light=CreateLight(3)
-
- ; Loading the heightmap
- terrain=LoadTerrain ( "highmountain.jpg" )
- ScaleEntity terrain,5,100,5
- PositionEntity terrain,-500,0,-500
- tex=LoadTexture( "greenery.jpg" )
- ScaleTexture tex, 50,50
- EntityTexture terrain,tex
-
-
- ; Create the terrain
- ground=CreateTerrain(512)
-
-
- ; This following code deals with cameras and terrain
- While Not KeyDown(ESC_KEY)
-
- If KeyDown(RIGHT_KEY)=True Then TurnEntity camera,0,-1,0
- If KeyDown(LEFT_KEY)=True Then TurnEntity camera,0,1,0
- If KeyDown(DOWN_KEY)=True Then MoveEntity camera,0,0,-1
- If KeyDown(UP_KEY)=True Then MoveEntity camera,0,0,1
-
- RenderWorld
- Flip
- Wend
- End