I have an object that can rotate around a sphere. Basically I need to move object from initial position to new position (From V1 to V2) using RotateAround. V1 is initial position and V2 is position that can be anywhere around the sphere. I have value of both Vectors so I can calculate angle with Vector3.Angle() but I don't know how to calculate proper axis to use in RotateAround() method.
Just use Vector3.up or Transform.up as in example
I think I get it. Assuming that V1
and V2
have the same length: Just find new vector perpendicular to this vectors using Vector3.cross
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.