CreateTerrain.bb 658 B

1234567891011121314151617181920212223242526272829303132333435
  1. ; CreateTerrain Example
  2. ; ---------------------
  3. Graphics3D 640,480
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. PositionEntity camera,0,1,0
  7. light=CreateLight()
  8. RotateEntity light,90,0,0
  9. ; Create terrain
  10. terrain=CreateTerrain(128)
  11. ; Texture terrain
  12. grass_tex=LoadTexture( "media/mossyground.bmp" )
  13. EntityTexture terrain,grass_tex
  14. While Not KeyDown( 1 )
  15. If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
  16. If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
  17. If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
  18. If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
  19. RenderWorld
  20. Text 0,0,"Use cursor keys to move about the terrain"
  21. Flip
  22. Wend
  23. End