lights.bb 1000 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ; Lighting ***
  2. ; By Paul Gerfen (www.gamecoding.co.uk)
  3. Graphics3D 800,600
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. CameraViewport camera,0,0,800,600
  7. AmbientLight 0,0,0
  8. ;cube 1
  9. cube=CreateCube()
  10. PositionEntity cube,0,0,5
  11. light=CreateLight(3)
  12. LightColor light,100,20,30
  13. LightConeAngles light,0,45
  14. PositionEntity light,0,0,0.5
  15. LightRange light,8
  16. PointEntity light,cube
  17. ;cube 2
  18. cube2=CopyEntity(cube)
  19. PositionEntity cube2,-5,0,8
  20. light2=CreateLight(3)
  21. LightColor light2,40,150,60
  22. LightConeAngles light,0,45
  23. PositionEntity light2,-5,0,4.5
  24. LightRange light2,8
  25. PointEntity light2,cube2
  26. ;cube 3
  27. cube3=CopyEntity(cube)
  28. PositionEntity cube3,5,0,8
  29. light3=CreateLight(3)
  30. LightColor light3,70,80,190
  31. LightConeAngles light,0,45
  32. PositionEntity light3,5,0,4.5
  33. LightRange light3,8
  34. PointEntity light3,cube3
  35. While Not KeyHit(1)
  36. TurnEntity cube,0.1,0.2,0.3
  37. TurnEntity cube2,0.3,0.2,0.1
  38. TurnEntity cube3,0.3,0.2,0.1
  39. UpdateWorld
  40. RenderWorld
  41. Text 310,500,"Coloured Lighting Demo"
  42. Flip
  43. Wend
  44. End