T
T
TheTalion2017-12-21 20:25:06
Linear algebra
TheTalion, 2017-12-21 20:25:06

What is the formula to calculate what rotation an object must have in order for this object to be perpendicular to a line from another object?

Given:
Object 1 is a character. We know its position and rotation in world coordinates.
Vector1 (x,y,z) - position of the character (object 1).
Rotator (x,y,z) - the current rotation of the character (object 1).
Object 2 is a screen.
Vector2(x,y,z) - screen position (a known point where the menu should be, calculated by getting the Forward Vector from the character + adding the required distance to it.).
Rotator2(x,y,z) - screen rotation (desired)
Picture for clarity. Image description:
Brown - earth.
Black is a character.
Blue is the distance to the screen.
Yellow is the screen.
5a3bebd3e2291175704956.png
What formula can be used to get the actual Rotator2 depending on the rotation of the character?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question