LightRange.htm 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>LightRange light,range#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. light - light handle <br />
  13. range# - range of light (default: 1000.0)
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Sets the range of a light. <br />
  22. <br />
  23. The range of a light is how far it reaches. Everything outside the range of the light will not be affected by it. <br />
  24. <br />
  25. The value is very approximate, and should be experimented with for best results.
  26. <br>
  27. <br>
  28. See also: <a class=small href=CreateLight.htm>CreateLight</a>, <a class=small href=LightColor.htm>LightColor</a>, <a class=small href=LightConeAngles.htm>LightConeAngles</a>.
  29. </td>
  30. </tr>
  31. </table>
  32. <h1><a href=../3d_examples/LightRange.bb>Example</a></h1>
  33. <table>
  34. <tr>
  35. <td>
  36. Graphics3D 640,480 <br />
  37. <br />
  38. camera = CreateCamera() <br />
  39. MoveEntity camera,0,0,-3 <br />
  40. <br />
  41. ball = CreateSphere() <br />
  42. <br />
  43. lite = CreateLight(2) ; try different lights 1 to 3 <br />
  44. MoveEntity lite,5,0,-5 <br />
  45. PointEntity lite,ball <br />
  46. <br />
  47. range# = 0.5 <br />
  48. LightRange lite,range <br />
  49. <br />
  50. While Not KeyDown(1) <br />
  51. RenderWorld:Flip <br />
  52. If KeyHit(57) Then ; hit SPACEBAR to increase light range <br />
  53. range = range + 0.5 <br />
  54. LightRange lite,range <br />
  55. EndIf <br />
  56. Wend <br />
  57. End
  58. </td>
  59. </tr>
  60. </table>
  61. <br>
  62. <a target=_top href=../index.htm>Index</a><br>
  63. <br>
  64. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=LightRange&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  65. </html>