Answer the question
In order to leave comments, you need to log in
How to calculate the angle between a point and another point with a quaternion?
Good afternoon!
I would be very grateful if someone could help me solve the following problem -
I have a sphere in 3D space. Its position is x1, y1, z1. There is a camera with a position x2, y2, z2 and a quaternion for the camera xq, yq, zq, wq. It is necessary to determine at what angle it is necessary to rotate the camera relative to the X, Y, Z planes where the sphere is located so that the camera points directly at the sphere.
Thanks
Answer the question
In order to leave comments, you need to log in
The easiest way to rotate the camera to a point is to use Transform.LookAt . If you just need to know the rotation, then you can use Quaternion.FromToRotation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question