PointLightHelper.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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>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]( [param:PointLight light], [param:Float sphereSize], [param:Hex color] )</h3>
  29. <p>
  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 color] -- (optional) if this is not the set the helper will take the color of the light.
  33. </p>
  34. <h2>Properties</h2>
  35. <p>See the base [page:Mesh] class for common properties.</p>
  36. <h3>[property:PointLight light]</h3>
  37. <p>The [page:PointLight] that is being visualized.</p>
  38. <h3>[property:object matrix]</h3>
  39. <p>Reference to the pointLight's [page:Object3D.matrixWorld matrixWorld].</p>
  40. <h3>[property:object matrixAutoUpdate]</h3>
  41. <p>
  42. See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
  43. pointLight's [page:Object3D.matrixWorld matrixWorld].
  44. </p>
  45. <h3>[property:hex color]</h3>
  46. <p>
  47. The color parameter passed in the constructor. Default is *undefined*. If this is changed, the helper's color will update
  48. the next time [page:.update update] is called.
  49. </p>
  50. <h2>Methods</h2>
  51. <p>See the base [page:Mesh] class for common methods.</p>
  52. <h3>[method:null dispose]()</h3>
  53. <p>Dispose of the pointLightHelper.</p>
  54. <h3>[method:null update]()</h3>
  55. <p>Updates the helper to match the position of the [page:.light].</p>
  56. <h2>Source</h2>
  57. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  58. </body>
  59. </html>