PointLightHelper.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Mesh] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">
  14. This displays a helper object consisting of a spherical [page:Mesh] for visualizing
  15. a [page:PointLight].
  16. </div>
  17. <h2>Example</h2>
  18. [example:webgl_helpers WebGL / helpers]
  19. <code>
  20. var pointLight = new THREE.PointLight( 0xff0000, 1, 100 );
  21. pointLight.position.set( 10, 10, 10 );
  22. scene.add( pointLight );
  23. var sphereSize = 1;
  24. var pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );
  25. scene.add( pointLightHelper );
  26. </code>
  27. <h2>Constructor</h2>
  28. <h3>[name]( [page:PointLight light], [page:Float sphereSize], [page:Hex overrideColor] )</h3>
  29. <div>
  30. [page:PointLight light] -- The light to be visualized. <br /><br />
  31. [page:Float sphereSize] -- (optional) The size of the sphere helper. Default is *1*.<br /><br />
  32. [page:Hex overrideColor] -- (optional) by default the helper will take the color of the light.
  33. In cases where this makes the helper difficult to see
  34. (for example a white light against a white background) you can directly set the color here.
  35. </div>
  36. <h2>Properties</h2>
  37. <div>See the base [page:Mesh] class for common properties.</div>
  38. <h3>[property:PointLight light]</h3>
  39. <div>The [page:PointLight] that is being visualized.</div>
  40. <h3>[property:object matrix]</h3>
  41. <div>Reference to the pointLight's [page:Object3D.matrixWorld matrixWorld].</div>
  42. <h3>[property:object matrixAutoUpdate]</h3>
  43. <div>
  44. See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
  45. pointLight's [page:Object3D.matrixWorld matrixWorld].
  46. </div>
  47. <h3>[property:hex overrideColor]</h3>
  48. <div>
  49. A color that overrides the default color of the helper. If this was not passed in the constructor but is set later, the helper's
  50. color will update the next time [page:.update update] is called.
  51. </div>
  52. <h2>Methods</h2>
  53. <div>See the base [page:Mesh] class for common methods.</div>
  54. <h3>[method:null dispose]()</h3>
  55. <div>Dispose of the pointLightHelper.</div>
  56. <h3>[method:null update]()</h3>
  57. <div>Updates the helper to match the position of the [page:.light].</div>
  58. <h2>Source</h2>
  59. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  60. </body>
  61. </html>