three.js - mesh group example? (THREE.Object3D() advanced)

后端 未结 2 797
抹茶落季
抹茶落季 2021-01-03 17:43

I\'m attempting to understand how to group / link child meshes to a parent. I want to be able to:

  • drag the parent
  • rotate child elements relative to t
2条回答
  •  抹茶落季
    2021-01-03 18:30

    another way, because a mesh can be a parent too

    meshParent.add(meshChild1);
    meshParent.add(meshChild2);
    scene.add(meshParent);
    

    or

    mesh1.add(mesh2);
    mesh3.add(mesh1);
    scene.add(mesh3);
    

    mesh3 manipulates all meshes, mesh1 manipulates itself and mesh2, mesh2 manipulates itself

提交回复
热议问题