BrushAlpha.bb 823 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ; BrushAlpha Example
  2. ; ------------------
  3. Graphics3D 640,480
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. ;PositionEntity camera,0,20,5
  7. ;RotateEntity camera,90,0,0
  8. light=CreateLight()
  9. RotateEntity light,90,0,0
  10. cube=CreateCube()
  11. PositionEntity cube,0,0,8
  12. cube2=CreateCube()
  13. PositionEntity cube2,6,0,8
  14. ; Create brush
  15. brush=CreateBrush()
  16. ; Set brush color
  17. BrushAlpha brush,0.5
  18. ; Paint mesh with brush
  19. PaintMesh cube,brush
  20. While Not KeyDown( 1 )
  21. pitch#=0
  22. yaw#=0
  23. roll#=0
  24. If KeyDown( 208 )=True Then pitch#=-1
  25. If KeyDown( 200 )=True Then pitch#=1
  26. If KeyDown( 203 )=True Then yaw#=-1
  27. If KeyDown( 205 )=True Then yaw#=1
  28. If KeyDown( 45 )=True Then roll#=-1
  29. If KeyDown( 44 )=True Then roll#=1
  30. TurnEntity cube,pitch#,yaw#,roll#
  31. MoveEntity cube2,0,0,0.1
  32. TurnEntity cube2,0,1,0
  33. RenderWorld
  34. Flip
  35. Wend
  36. End