I have three cube meshes (A, B, C) each within a group. Then I parented the groups into a hierarchy.
Group A -> Group B -> Group C
I need to rotate group B around a world axis and the find the position of mesh C.
For rotation around a world axis I used the code given here
I have a small rotate_cubes
function to perform the rotation. After rotation it logs the result of getWorldPosition()
. But I do not get the updated position. I get the old position of the cube C.
function rotate_cubes(group) {
group.rotateAroundWorldAxis(make_vector3(), make_vector3(1, 0, 0), 15 * THREE.Math.DEG2RAD)
let pos = make_vector3()
cube3.getWorldPosition(pos)
console.log(pos)
}
How can I calculate its position after rotation?
Thanks for the help.