home *** CD-ROM | disk | FTP | other *** search
- ;demo09-06.bb - Shapes and 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()
-
- ;Create our terrain
- ground=CreateTerrain(512)
- PositionEntity ground, -500,0,-500
- ScaleEntity ground, 10,15,10
- tex=LoadTexture( "greenery.jpg" )
- EntityTexture ground, tex
-
-
- ;Creating the sky
- sky = CreateSphere (40)
- FlipMesh sky
- ScaleEntity sky, 100,100,100
- PositionEntity sky, 0,50,0
- sky_tex = LoadTexture ( "sky2.jpg" )
- EntityTexture sky,sky_tex
- EntityFX sky,1
-
-
- ; 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,-0.5
- If KeyDown(UP_KEY)=True Then MoveEntity camera,0,0,0.5
-
- RenderWorld
- Flip
- Wend
- End