Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions docs/api/lights/DirectionalLight.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ <h2>Example</h2>
</p>

<code>
// White directional light at half intensity shining from the top.
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
scene.add( directionalLight );
</code>
// White directional light at half intensity shining from the top.
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
scene.add( directionalLight );
</code>


<h2>Constructor</h2>
Expand Down Expand Up @@ -104,26 +104,28 @@ <h3>[property:Object3D target]</h3>

*Note*: For the target's position to be changed to anything other than the default,
it must be added to the [page:Scene scene] using
<code>
scene.add( light.target );
</code>

</p>
<code>
scene.add( light.target );
</code>
<p>
This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically
updated each frame.<br /><br />

It is also possible to set the target to be another object in the scene (anything with a
[page:Object3D.position position] property), like so:
<code>
var targetObject = new THREE.Object3D();
scene.add(targetObject);
</p>
<code>
var targetObject = new THREE.Object3D();
scene.add(targetObject);

light.target = targetObject;
</code>
light.target = targetObject;
</code>
<p>
The directionalLight will now track the target object.
</p>



<h2>Methods</h2>

See the base [page:Light Light] class for common methods.
Expand Down