PointLightHelper.html 2.3 KB

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