I have been attempting to transfer one object's rotation to another with no success using the following methods:
//The first method rotates much faster than the original object's rotation
boxme1.rotateOnAxis(new t.Vector3(0,1,0), cube.rotation.y);
//In this method, the vector and quaternion are meant to determine the direction the
//object is facing. However, when applying the vector to a Euler for rotation,
//the object disappears from the scene. I'm unsure if this is the correct way to use an Euler.
var vector = new t.Vector3(0,0,-1);
vector.applyQuaternion(cube.quaternion);
var euler = new t.Euler(vector.x, vector.y, vector.z);
boxme1.rotateOnAxis(new t.Vector3(0,1,0),euler);
//When setting the object rotation with the above Euler instead of using rotateOnAxis,
//the object does not move at all.
boxme1.rotation = euler;
What is the proper way to apply the rotation of one object to another? The issue seems unrelated to the cube rotation as it is functioning correctly. At the moment, I am still learning Three.js so any guidance would be appreciated.
Thank you in advance