BrushTexture.bb 721 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ; BrushTexture Example
  2. ; --------------------
  3. Graphics3D 640,480
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. light=CreateLight()
  7. RotateEntity light,90,0,0
  8. cube=CreateCube()
  9. PositionEntity cube,0,0,5
  10. ; Load texture
  11. tex=LoadTexture( "media/b3dlogo.jpg" )
  12. ; Create brush
  13. brush=CreateBrush()
  14. ; Apply texture to brush
  15. BrushTexture brush,tex
  16. ; Paint mesh with brush
  17. PaintMesh cube,brush
  18. While Not KeyDown( 1 )
  19. pitch#=0
  20. yaw#=0
  21. roll#=0
  22. If KeyDown( 208 )=True Then pitch#=-1
  23. If KeyDown( 200 )=True Then pitch#=1
  24. If KeyDown( 203 )=True Then yaw#=-1
  25. If KeyDown( 205 )=True Then yaw#=1
  26. If KeyDown( 45 )=True Then roll#=-1
  27. If KeyDown( 44 )=True Then roll#=1
  28. TurnEntity cube,pitch#,yaw#,roll#
  29. RenderWorld
  30. Flip
  31. Wend
  32. End