T
T
TheTalion2018-02-08 20:32:54
C++ / C#
TheTalion, 2018-02-08 20:32:54

What is the formula to determine where the character is - behind another character, in front, right-left, etc.?

In general, there is a character (vector3), a point where the character is looking (vector3). View Angle(int).
There is also a point - the second character (vector3). It is necessary to determine where the second character is located - behind the character's back or in front of the face?
Tell me where to dig, what formulas and so on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Griboks, 2018-02-08
@TheTalion

Check the angle between the vectors and, if the second point falls within the viewing angle, the distance between the points. Actually, that's all, it remains only to remember the school formulas. Of course, I will not rewrite them here)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question