未验证 提交 49a4818f 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #14448 from paulmasson/patch-1

Docs: Add tags to fix whitespace issue
......@@ -52,10 +52,10 @@
</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>
......@@ -104,26 +104,28 @@ scene.add( directionalLight );
*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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册