Why I get the same result in Object3D.getWorldPosition()?

var a = new THREE.Object3D();
a.translateY(10)
a.updateMatrixWorld();
console.log(a.getWorldPosition( new THREE.Vector3(0,5,1) ));
console.log(a.getWorldPosition( new THREE.Vector3(0,0,1) ));

console display is
n {x: 0, y: 10, z: 0}
n {x: 0, y: 10, z: 0}
I just want the wold position. How to get it?
I think it should be (0,15,1) and (0,10,1)

THREE.REVISION is 101
Thanks

It seems you are not using Object3D.getWorldPosition() correctly. The parameter of the method is just the target vector where the result (the position of a in world space) is stored. That’s the reason why have for both invocations the same result.

It seems you want to use Object3D.localToWorld().

https://jsfiddle.net/u563whr4/

1 Like

Oh, yes, you are right. I am confuse by these functions.
Thanks so much