Calculate 3D rotation of a point
How do I calculate the pitch, yaw, and roll angles for a point in 3D space?
I'm working on a game where the player 开发者_StackOverflow社区character must face towards an object that's flying around.
For yaw, use the atan2() of the X and Y coordinates. For the pitch, use the X-Y magnitude and the Z coordinate. Points don't have a roll.
精彩评论