Real life frame position to position relative to camera rotation
I'm in a project in which I have an external sensor which gives me the pitch, roll and yaw of the object as well as its position in real life coordinate frame x, y, z in a script that I have attached to the main camera. I have succesfully implemented the rotation as: transform.rotation = Quaternion.Euler(rotationPitch, rotationYaw, rotacionRoll);
However, for the position, If I do: v3pos = new Vector3(position[0], position[1], position[2]); transform.position = v3pos;
It kinda works but only If I have my real object facing front, if for example I turn it 90º to the left and then move it "forward", in reality is to the left in real world frame, it moves the camera to the left, and not forward as I would want.
How do I do this change?
Thanks in advance.
Your answer
Follow this Question
Related Questions
My camera is moving away from the object it's rotating around, how do I fix this? 0 Answers
Perfectly Syncing the rotation of two objects 0 Answers
How can I make an object transform to given position and rotation 2 Answers
Enemy not facing player when enter rotation orbit 0 Answers
How to transform a GameObject to an Empty GameObject's position and rotation 1 Answer