PointLightHelper.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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
  14. visualizing 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>[example:webgl_helpers WebGL / helpers]</p>
  27. <h2>Constructor</h2>
  28. <h3>
  29. [name]( [param:PointLight light], [param:Float sphereSize], [param:Hex color] )
  30. </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.
  34. Default is `1`.<br /><br />
  35. [page:Hex color] -- (optional) if this is not the set the helper will take
  36. the color of the light.
  37. </p>
  38. <h2>Properties</h2>
  39. <p>See the base [page:Mesh] class for common properties.</p>
  40. <h3>[property:PointLight light]</h3>
  41. <p>The [page:PointLight] that is being visualized.</p>
  42. <h3>[property:Object matrix]</h3>
  43. <p>
  44. Reference to the pointLight's [page:Object3D.matrixWorld matrixWorld].
  45. </p>
  46. <h3>[property:Object matrixAutoUpdate]</h3>
  47. <p>
  48. See [page:Object3D.matrixAutoUpdate]. Set to `false` here as the helper is
  49. using the pointLight's [page:Object3D.matrixWorld matrixWorld].
  50. </p>
  51. <h3>[property:hex color]</h3>
  52. <p>
  53. The color parameter passed in the constructor. Default is `undefined`. If
  54. this is changed, the helper's color will update the next time
  55. [page:.update update] is called.
  56. </p>
  57. <h2>Methods</h2>
  58. <p>See the base [page:Mesh] class for common methods.</p>
  59. <h3>[method:undefined dispose]()</h3>
  60. <p>
  61. Frees the GPU-related resources allocated by this instance. Call this
  62. method whenever this instance is no longer used in your app.
  63. </p>
  64. <h3>[method:undefined update]()</h3>
  65. <p>Updates the helper to match the position of the [page:.light].</p>
  66. <h2>Source</h2>
  67. <p>
  68. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  69. </p>
  70. </body>
  71. </html>