无论镜头距离多远,始终在屏幕上以相同速度旋转对象?

问题描述 投票:0回答:1

我正在旋转像XCOM的全息图一样的地球仪,

enter image description here

我使用Quaternion.RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta)旋转它。

我发现maxDegreesDelta的价值很高,在我的情况下是5.0f

摄像机的近距离有一个限制,假设clos为1.0f,远为2.0f

我希望能够放大地球,但是显然当我这样做时,它旋转得太快了。

缩小时,旋转速度令人满意:

enter image description here

放大时,旋转速度太快,使其难以操作:

enter image description here

而且随着游戏视图尺寸变大,即全屏,问题更加明显。

使用Mathf.LerpMathf.InverseLerp,我尝试使maxDegreesDelta和鼠标增量与相机的距离成正比,但这很难令人信服。

注意:我旋转地球仪,而不是相机。

问题:

无论摄像机近近如何,如何确保对象在屏幕上以相同的速度旋转?

c# unity3d rotation mouse angle
1个回答
0
投票

而不是忍受maxDegreesDelta,您是否考虑过忍受[[mouse delta]]本身?它可以更直接地修改灵敏度。

© www.soinside.com 2019 - 2024. All rights reserved.