Real life frame position to relative position 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
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
Car Controls without physics. 1 Answer
How do I change the position of my player model after I rotate it so it's not teleporting? 0 Answers
Quaternion.RotateTowards for camera positions is buggy 1 Answer