|
@@ -18,19 +18,20 @@
|
|
|
There are two ways to update an object's transformation:
|
|
|
<ol>
|
|
|
<li>
|
|
|
- Modify the object's *position*, *quaternion*, and *scale* properties, then ask Three.js to recompute the object's matrix from these properties:
|
|
|
+ Modify the object's *position*, *quaternion*, and *scale* properties, and let Three.js recompute
|
|
|
+ the object's matrix from these properties:
|
|
|
<code>
|
|
|
- object.position = start_position;
|
|
|
- object.quaternion = quaternion;
|
|
|
- object.updateMatrix();
|
|
|
+ object.position.copy(start_position);
|
|
|
+ object.quaternion.copy(quaternion);
|
|
|
</code>
|
|
|
- Calling the *updateMatrix* method forces the object's matrix to be recomputed from *position*, *quaternion*, and *scale*. You can also set
|
|
|
+ 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 = true;
|
|
|
+ object.matrixAutoUpdate = false;
|
|
|
</code>
|
|
|
- in lieu of calling *updateMatrix*. This will force the matrix to be recomputed every frame; for static objects, you should therefore set
|
|
|
+ And after changing any properties, manually update the matrix:
|
|
|
<code>
|
|
|
- object.matrixAutoUpdate = false;
|
|
|
+ object.updateMatrix();
|
|
|
</code>
|
|
|
</li>
|
|
|
<li>
|
|
@@ -61,4 +62,4 @@
|
|
|
</p>
|
|
|
|
|
|
</body>
|
|
|
-</html>
|
|
|
+</html>
|