本文介绍了如何从 3D 矢量获得偏航、俯仰和滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用于某个位置的方向向量,它为我提供了相机应注视的点.我怎样才能从偏航、俯仰和滚转中获得正确使用 glRotatef 的能力?

I have a direction vector that applied to a position gives me the point at which the camera should look. How can I get from that yaw, pitch and roll in order to use glRotatef properly?

提前致谢

推荐答案

您可能实际上并不想要偏航、俯仰和滚转.你只需要正确的转换.尝试使用 gluLookAt 来构建它.文档.

You probably don't actually want the yaw, pitch and roll. You just need the correct transformation. Try using gluLookAt to build it. Documentation.

这篇关于如何从 3D 矢量获得偏航、俯仰和滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 23:48