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

  1. Rem * Title  : Camera Display Data
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 5
  6. rem ==========================================
  7. rem This program reads all camera data
  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 Activate manual sync
  19. sync on
  20.  
  21. rem Begin loop
  22. do
  23.  
  24. rem Control camera with arrow keys
  25. if upkey()=1 then x#=newxvalue(x#,a#,10) : z#=newzvalue(z#,a#,10)
  26. if downkey()=1 then x#=newxvalue(x#,a#,-10) : z#=newzvalue(z#,a#,-10)
  27. if leftkey()=1 then a#=wrapvalue(a#-10.0)
  28. if rightkey()=1 then a#=wrapvalue(a#+10.0)
  29.  
  30. rem Update camera
  31. position camera x#,50,z#
  32. yrotate camera a#
  33.  
  34. rem Output camera data to screen
  35. set cursor 0,0
  36. print "Camera Data"
  37. print "-----------"
  38. print "camera pos x=";camera position x()
  39. print "camera pos y=";camera position y()
  40. print "camera pos z=";camera position z()
  41. print "camera rot x=";camera angle x()
  42. print "camera rot y=";camera angle y()
  43. print "camera rot z=";camera angle z()
  44.  
  45. rem Syncronise
  46. sync
  47.  
  48. rem End loop
  49. loop
  50.