简体   繁体   English

3d相机-如何更改相机方向?

[英]3d Camera - How to Change Camera Orientation?

Say I have a world object at point W and a camera at point C. How do I make the camera point at the object? 假设我在W点有一个世界对象,而在C点有一个摄像机。如何使摄像机指向该对象?

If I have one vector UP that is (0,2,0) how do I show the rotation matrix for this camera? 如果我有一个向量UP为(0,2,0),如何显示此摄像机的旋转矩阵?

Any helpful references would be appreciated, Thanks! 任何有用的参考将不胜感激,谢谢!

Follow this Nehe article on cameras: 在相机上关注此Nehe文章:
http://nehe.gamedev.net/article/camera_class_tutorial/18010/ http://nehe.gamedev.net/article/camera_class_tutorial/18010/

Particularly the "Following Targets" section where it shows how to get the camera vectors for looking at an arbitrary point. 特别是“跟随目标”部分,其中显示了如何获取用于观察任意点的摄像机矢量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM