home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / camera3d / exam02.dba < prev    next >
Encoding:
Text File  |  1999-09-07  |  996 b   |  43 lines

  1. Rem * Title  : First Person Camera
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ===========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 2
  6. rem ===========================================
  7. rem This program operates a first person camera
  8. rem -------------------------------------------
  9.  
  10. rem Make a simple scene for the camera to look at
  11. make matrix 1,10000.0,10000.0,25,25
  12. load bitmap "floor1.bmp",1
  13. get image 1,0,0,256,256
  14. delete bitmap 1
  15. prepare matrix texture 1,1,2,2
  16. randomize matrix 1,50.0
  17.  
  18. rem Position camera
  19. position camera 5000,200,5000
  20.  
  21. rem Activate manual sync
  22. sync on
  23.  
  24. rem Begin loop
  25. do
  26.  
  27. rem Control camera with arrow keys
  28. if upkey()=1 then move camera 10.0
  29. if downkey()=1 then move camera -10.0
  30. if leftkey()=1 then angley#=wrapvalue(angley#-2.0)
  31. if rightkey()=1 then angley#=wrapvalue(angley#+2.0)
  32.  
  33. rem Update camera
  34. xrotate camera 0.0
  35. yrotate camera angley#
  36. zrotate camera 0.0
  37.  
  38. rem Syncronise
  39. sync
  40.  
  41. rem End loop
  42. loop
  43.