简体   繁体   中英

Three.js: Applying matrix to group of objects and then updating their locations

当我们将场景中的对象添加到组(现在称为Object3D())时,如何为组对象应用正确的矩阵,以便它们的位置在场景中得到更新。

So, as far as I know -by default ; object automatically update their matrices if they have been added to the scene with

var object = new THREE.Object3D();

scene.add( object );

if they are the child of another object that has been added to the scene:

var object1 = new THREE.Object3D();
var object2 = new THREE.Object3D();

object1.add( object2 );
scene.add( object1 );

 //object1 and object2 will automatically update their matrices

There is more here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM