如何获得偏航,俯仰和横滚从3D矢量 [英] How to get Yaw, Pitch and Roll from a 3D vector

查看:368
本文介绍了如何获得偏航,俯仰和横滚从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矢量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆