正交相机的旋转 [英] Rotation of Orthographic Camera

查看:122
本文介绍了正交相机的旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够用这个code旋转摄像头

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.

我想,无论是拉在0度后,我的屏幕停止。

I want that my screen stops after zooming at 0 degree.

推荐答案

在你的code段

**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屋!

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