PointLightHelper.html 2.3 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:Object3D] &rarr; [page:Mesh] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. This displays a helper object consisting of a spherical [page:Mesh] for visualizing
  15. a [page:PointLight].
  16. </p>
  17. <h2>Code Example</h2>
  18. <code>
  19. var pointLight = new THREE.PointLight( 0xff0000, 1, 100 );
  20. pointLight.position.set( 10, 10, 10 );
  21. scene.add( pointLight );
  22. var sphereSize = 1;
  23. var pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );
  24. scene.add( pointLightHelper );
  25. </code>
  26. <h2>Examples</h2>
  27. <p>
  28. [example:webgl_helpers WebGL / helpers]
  29. </p>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [param:PointLight light], [param:Float sphereSize], [param:Hex color] )</h3>
  32. <p>
  33. [page:PointLight light] -- The light to be visualized. <br /><br />
  34. [page:Float sphereSize] -- (optional) The size of the sphere helper. Default is *1*.<br /><br />
  35. [page:Hex color] -- (optional) if this is not the set the helper will take the color of the light.
  36. </p>
  37. <h2>Properties</h2>
  38. <p>See the base [page:Mesh] class for common properties.</p>
  39. <h3>[property:PointLight light]</h3>
  40. <p>The [page:PointLight] that is being visualized.</p>
  41. <h3>[property:object matrix]</h3>
  42. <p>Reference to the pointLight's [page:Object3D.matrixWorld matrixWorld].</p>
  43. <h3>[property:object matrixAutoUpdate]</h3>
  44. <p>
  45. See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
  46. pointLight's [page:Object3D.matrixWorld matrixWorld].
  47. </p>
  48. <h3>[property:hex color]</h3>
  49. <p>
  50. The color parameter passed in the constructor. Default is *undefined*. If this is changed, the helper's color will update
  51. the next time [page:.update update] is called.
  52. </p>
  53. <h2>Methods</h2>
  54. <p>See the base [page:Mesh] class for common methods.</p>
  55. <h3>[method:null dispose]()</h3>
  56. <p>Dispose of the pointLightHelper.</p>
  57. <h3>[method:null update]()</h3>
  58. <p>Updates the helper to match the position of the [page:.light].</p>
  59. <h2>Source</h2>
  60. <p>
  61. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  62. </p>
  63. </body>
  64. </html>