How to get the global/world position of a child object?

后端 未结 2 2002
误落风尘
误落风尘 2020-11-29 23:10

How do I get the global position of an Object3D inside another Object3D?

setup:

var parent = new THREE.Object3D();
parent.position.s         


        
2条回答
  •  日久生厌
    2020-11-29 23:40

    You can extract the world position like so:

    var target = new THREE.Vector3(); // create once an reuse it
    
    child.getWorldPosition( target );
    

    target will contain the result.

    EDIT: updated to three.js r.120

提交回复
热议问题