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

  1. Rem * Title  : A Simple Camera
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 1
  6. rem ==========================================
  7. rem This program operates a simple 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 Begin loop
  22. do
  23.  
  24. rem Control camera with arrow keys
  25. if leftkey()=1 then angley#=wrapvalue(angley#-2.0)
  26. if rightkey()=1 then angley#=wrapvalue(angley#+2.0)
  27.  
  28. rem Update camera
  29. rotate camera 0,angley#,0
  30.  
  31. rem End loop
  32. loop
  33.