开发者

Calculate 3D rotation of a point

开发者 https://www.devze.com 2023-01-18 02:40 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消