正交相机的旋转 [英] Rotation of Orthographic Camera
本文介绍了正交相机的旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以使用此代码旋转相机
I am able to rotate camera with this code
camera.zoom = 3//in constructor
if(camera.zoom>1)
{
camera.zoom-=0.01f;
camera.rotate(15);
}
这是在渲染,现在缩放效果正常工作,屏幕保持以当前角度旋转。如下所示。
this is done in render, Now zooming effect works properly but when zooming completes my screen is stay rotated with current angle. like below.
我
推荐答案
在您的代码片段
**camera.zoom=3;**
并且在每次迭代中,您都会通过 0.01 缩放相机,直到 camera.zoom> 1
,因此您总共需要进行20次缩放。
and in each iteration you are zooming camera by 0.01 till camera.zoom > 1 so you have total 20 iteration for zooming
然后以 18 角度旋转,在迭代后以 360 度旋转。
Then rotate with 18 degree angle after iteration it will rotate in 360 degree.
这篇关于正交相机的旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文