home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / basic3d / exam07.dba < prev    next >
Encoding:
Text File  |  1999-12-08  |  925 b   |  42 lines

  1. Rem * Title  : Fogging Effect
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 7
  6. rem ==========================================
  7. rem This program creates the effect of fogging
  8. rem ------------------------------------------
  9.  
  10. rem placing SYNC ON here prevent the user seeing the object
  11. rem before you are ready to display it (with the SYNC command)
  12. sync on
  13.  
  14. rem Load your object
  15. load object "walk.x",1
  16. color backdrop 0
  17.  
  18. rem Create fog (if supported)
  19. fog on
  20. fog color 0
  21. fog distance 1000
  22.  
  23. rem Cast dark ambience
  24. set ambient light 5
  25.  
  26. rem Begin main loop
  27. while mouseclick()=0
  28.  
  29. rem Position the object to circle in and out of the fog
  30. a#=wrapvalue(a#+2.0)
  31. yrotate object 1,a#
  32. position object 1,sin(a#)*100.0,0.0,(cos(a#)*500.0)+250.0
  33.  
  34. rem Update Screen
  35. sync
  36.  
  37. rem End main loop
  38. endwhile
  39.  
  40. rem Deactivate fog
  41. fog off
  42.