AMesh’s position=[1, 1, 1],rotation=[Math.PI / 3, 0, 0] ,group’s position=[2, 2, 2],rotation=[Math.PI / 4, 0, 0] ,I put the AMesh in the Group. How to calculate the position and rotation after placement so that the position and rotation are consistent.
Here is link
here is my link ,Stage presets, gltfjsx (forked) - CodeSandbox
I calculate it’s position and rotation, but it cannot be aligned with the coordinates of amesh.
Can’t see a point of using that second group in this case tho
I need to move to the second group, I need to do an animation, so I need to calculate the coordinates after the movement to be visually consistent
@donmccurdy I found this related question, but I see how to convert this world coordinates to local coordinates, also including his rotation information conversion, but I still don’t know how to do a conversion, can you help me
I find a way to relove.
GMesh.updateMatrixWorld(); const obj = new THREE.Object3D(); obj.position.set(AMesh.position.x, AMesh.position.y, AMesh.position.z); obj.rotation.set(AMesh.rotation.x, AMesh.rotation.y, AMesh.rotation.z); obj.applyMatrix4(GMesh.matrixWorld.invert()); const BMeshPosition = obj.position; const BMeshQuaternion = obj.quaternion;