0

I am implementing a camera class and am getting stuck with some things

Let's suppose the camera is at Point (0,0,0) looking at a certain direction with its corresponding UP and RIGHT vectors.

I have a joystick control which allows you to go forward-backwards, or change orientation by moving (left-right) or (up-down), according to the above mentioned vectors.

How can I know, given the 3 vectors, which is the resulting direction vector if for instance I want to move N degrees right??

4

1 回答 1

1

如果您正在谈论旋转相机,那么它是如何完成的:每次旋转都是一个变换坐标的矩阵,所以您所要做的就是计算旋转矩阵,然后将其应用于 Dir、Up 和 Right 向量旋转完成后获取新的相机。

这里有一点关于旋转矩阵的阅读(阅读 3D 旋转部分): http: //mathworld.wolfram.com/RotationMatrix.html

于 2014-06-03T16:51:58.763 回答