|
@@ -12,12 +12,12 @@
|
|
|
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">
|
|
|
+ <p class="desc">
|
|
|
This light gets emitted from a single point in one direction, along a cone that increases in size
|
|
|
the further from the light it gets. <br /><br />
|
|
|
|
|
|
This light can cast shadows - see the [page:SpotLightShadow] page for details.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
|
|
|
|
|
@@ -25,13 +25,13 @@
|
|
|
<h2>Example</h2>
|
|
|
|
|
|
<iframe src='../examples/webgl_lights_spotlight.html'></iframe>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
[example:webgl_lights_spotlight View in Examples ]
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Other Examples</h2>
|
|
|
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
[example:webgl_interactive_cubes_gpu interactive / cubes / gpu ]<br />
|
|
|
[example:webgl_interactive_draggablecubes interactive / draggablecubes ]<br />
|
|
|
[example:webgl_materials_bumpmap_skin materials / bumpmap / skin ]<br />
|
|
@@ -43,7 +43,7 @@
|
|
|
[example:webgl_shadowmap shadowmap]<br/>
|
|
|
[example:webgl_shadowmap_performance shadowmap / performance]<br/>
|
|
|
[example:webgl_shadowmap_viewer shadowmap / viewer]
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Code Example</h2>
|
|
|
<code>
|
|
@@ -68,7 +68,7 @@
|
|
|
|
|
|
|
|
|
<h3>[name]( [param:Integer color], [param:Float intensity], [param:Float distance], [param:Radians angle], [param:Float penumbra], [param:Float decay] )</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
|
|
|
[page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
|
|
|
[page:Float distance] - Maximum distance from origin where light will shine whose intensity
|
|
@@ -80,59 +80,59 @@
|
|
|
[page:Float decay] - The amount the light dims along the distance of the light.<br /><br />
|
|
|
|
|
|
Creates a new [name].
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Properties</h2>
|
|
|
|
|
|
See the base [page:Light Light] class for common properties.
|
|
|
|
|
|
<h3>[property:Float angle]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
Maximum extent of the spotlight, in radians, from its direction. Should be no more than
|
|
|
*Math.PI/2*. The default is *Math.PI/3*.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
|
|
|
<h3>[property:Boolean castShadow]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and
|
|
|
requires tweaking to get shadows looking right. See the [page:SpotLightShadow] for details.
|
|
|
The default is *false*.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Float decay]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
The amount the light dims along the distance of the light.<br />
|
|
|
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to
|
|
|
physically realistic light falloff. The default is *1*.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Float distance]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
If non-zero, light will attenuate linearly from maximum intensity at the light's
|
|
|
position down to zero at this distance from the light. Default is *0.0*.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean isSpotLight]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
Used to check whether this or derived classes are spot lights. Default is *true*.<br /><br />
|
|
|
|
|
|
You should not change this, as it used internally for optimisation.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Float penumbra]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
Percent of the spotlight cone that is attenuated due to penumbra. Takes values between
|
|
|
zero and 1. The default is *0.0*.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Vector3 position]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
This is set equal to [page:Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Float power]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
The light's power.<br />
|
|
|
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the luminous
|
|
|
power of the light measured in lumens. Default is *4Math.PI*. <br /><br />
|
|
@@ -142,16 +142,16 @@
|
|
|
power = intensity * π
|
|
|
</code>
|
|
|
and changing this will also change the intensity.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:SpotLightShadow shadow]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
A [page:SpotLightShadow] used to calculate shadows for this light.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
|
|
|
<h3>[property:Object3D target]</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
The Spotlight points from its [page:.position position] to target.position. The default
|
|
|
position of the target is *(0, 0, 0)*.<br />
|
|
|
|
|
@@ -173,7 +173,7 @@ scene.add(targetObject);
|
|
|
light.target = targetObject;
|
|
|
</code>
|
|
|
The spotlight will now track the target object.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
|
|
|
<h2>Methods</h2>
|
|
@@ -181,10 +181,10 @@ light.target = targetObject;
|
|
|
See the base [page:Light Light] class for common methods.
|
|
|
|
|
|
<h3>[method:SpotLight copy]( [param:SpotLight source] )</h3>
|
|
|
- <div>
|
|
|
+ <p>
|
|
|
Copies value of all the properties from the [page:SpotLight source] to this
|
|
|
SpotLight.
|
|
|
- </div>
|
|
|
+ </p>
|
|
|
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
</body>
|