home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / matrix3d / exam03.dba < prev    next >
Encoding:
Text File  |  2000-04-09  |  1.1 KB  |  47 lines

  1. Rem * Title  : Matrix Texturing
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ===========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 3
  6. rem ===========================================
  7. rem This program will texture and tile a matrix
  8. rem -------------------------------------------
  9.  
  10. load bitmap "floor1.bmp",1
  11. get image 1,0,0,256,256
  12. delete bitmap 1
  13.  
  14. rem Make a matrix
  15. make matrix 1,1000,1000,11,11
  16.  
  17. rem Prepare matrix with a texture cut into a 2x2 texture grid 
  18. prepare matrix texture 1,1,2,2
  19.  
  20. rem Fill matrix with first texture tile
  21. fill matrix 1,0.0,1
  22. for x=0 to 10
  23.     for y=0 to 10
  24.         if rnd(2)=0 then set matrix tile 1,x,y,2
  25.         set matrix tile 1,0,y,3
  26.         set matrix tile 1,10,y,3
  27.         set matrix tile 1,x,0,3
  28.         set matrix tile 1,x,10,3
  29.         set matrix tile 1,x,5,4
  30.         set matrix tile 1,x,5,4
  31.     next y
  32. next x
  33. update matrix 1
  34.  
  35. rem Place and point camera to see matrix properly
  36. position camera 500,500,-200
  37. point camera 500,0,500
  38.  
  39. rem Wait for key press
  40. suspend for key
  41.  
  42. rem Delete the matrix
  43. delete matrix 1
  44.  
  45. rem End the program
  46. end
  47.