PointLight.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. PointLight - A point light
  2. --------------------------
  3. .. ...............................................................................
  4. .. rubric:: Constructor
  5. .. ...............................................................................
  6. .. class:: PointLight( hex, intensity, distance )
  7. A point light
  8. Part of scene graph
  9. Inherits from :class:`Light` :class:`Object3D`
  10. Affects :class:`MeshLambertMaterial` and :class:`MeshPhongMaterial`
  11. :param integer hex: light color
  12. :param float intensity: light intensity
  13. :param float distance: distance affected by light
  14. .. ...............................................................................
  15. .. rubric:: Attributes
  16. .. ...............................................................................
  17. .. attribute:: PointLight.color
  18. Light :class:`Color`
  19. .. attribute:: PointLight.intensity
  20. Light intensity
  21. ``default 1.0``
  22. .. attribute:: PointLight.position
  23. Position of the light
  24. .. attribute:: PointLight.distance
  25. If non-zero, light will attenuate linearly from maximum intensity at light ``position`` down to zero at ``distance``
  26. .. ...............................................................................
  27. .. rubric:: Example
  28. .. ...............................................................................
  29. ::
  30. // red point light shining from the front
  31. var pointLight = new THREE.PointLight( 0xff0000 );
  32. pointLight.position.set( 0, 0, 10 );
  33. scene.add( pointLight );