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

Merge pull request #15880 from Mugen87/dev24

Docs: Clean up
......@@ -22,25 +22,25 @@
Modify the object's *position*, *quaternion*, and *scale* properties, and let three.js recompute
the object's matrix from these properties:
<code>
object.position.copy(start_position);
object.quaternion.copy(quaternion);
object.position.copy( start_position );
object.quaternion.copy( quaternion );
</code>
By default, the *matrixAutoUpdate* property is set true, and the matrix will be automatically recalculated.
If the object is static, or you wish to manually control when recalculation occurs, better performance can be obtained by setting the property false:
<code>
object.matrixAutoUpdate = false;
object.matrixAutoUpdate = false;
</code>
And after changing any properties, manually update the matrix:
<code>
object.updateMatrix();
object.updateMatrix();
</code>
</li>
<li>
Modify the object's matrix directly. The [page:Matrix4] class has various methods for modifying the matrix:
<code>
object.matrix.setRotationFromQuaternion(quaternion);
object.matrix.setPosition(start_position);
object.matrixAutoUpdate = false;
object.matrix.setRotationFromQuaternion( quaternion );
object.matrix.setPosition( start_position );
object.matrixAutoUpdate = false;
</code>
Note that *matrixAutoUpdate* <em>must</em> be set to *false* in this case, and you should make sure <em>not</em> to call *updateMatrix*. Calling *updateMatrix* will clobber the manual changes made to the matrix, recalculating the matrix from *position*, *scale*, and so on.
</li>
......
......@@ -22,25 +22,25 @@
<li>
修改对象的*position*,*quaternion*和*scale*属性,让three.js重新计算来自这些属性的对象矩阵:
<code>
object.position.copy(start_position);
object.quaternion.copy(quaternion);
object.position.copy( start_position );
object.quaternion.copy( quaternion );
</code>
默认情况下,*matrixAutoUpdate*属性设置为true,并且将自动重新计算矩阵。
如果对象是静态的,或者您希望在重新计算时手动控制,则可以通过将属性设置为false来获得更好的性能:
<code>
object.matrixAutoUpdate = false;
object.matrixAutoUpdate = false;
</code>
更改任何属性后,手动更新矩阵:
<code>
object.updateMatrix();
object.updateMatrix();
</code>
</li>
<li>
直接修改对象的矩阵。 [page:Matrix4]类有各种修改矩阵的方法:
<code>
object.matrix.setRotationFromQuaternion(quaternion);
object.matrix.setPosition(start_position);
object.matrixAutoUpdate = false;
object.matrix.setRotationFromQuaternion( quaternion );
object.matrix.setPosition( start_position );
object.matrixAutoUpdate = false;
</code>
请注意,在这种情况下,*matrixAutoUpdate* <em> 必须 </em>设置为*false*,并且您应该确保<em></em>调用*updateMatrix*。
调用*updateMatrix*将破坏对矩阵所做的手动更改,从*position*,*scale*重新计算矩阵,依此类推。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册