OpenGL缩放的不同方式 [英] Different ways of zooming in OpenGL

查看:135
本文介绍了OpenGL缩放的不同方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我通过基于某些用户输入(键盘功能)将相机位置转换为z方向,从而在OpenGL中实现了缩放效果.现在,我看了其他几个使用缩放的示例,是否有不同的方法使人有些困惑:例如,通过使用glm :: perspective更改FOV.更改The fov和我的z平移之间是否有区别,如果有,哪种方法更好?我还不太了解的是何时在缩放的情况下使用glm :: scale,因为我也没有使用它.

At the moment I'm achieving a zoom effect in OpenGL by translating the camera position into z direction based on some user input (keyboard functions). Now I've looked at several other examples that use zooming and got a little bit confused whether there are different ways of doing this: for example by changing the FOV with glm::perspective. Is there a difference between changing The fov and my z-translation, and if so, which way is better? What I also don't really understand is when to use glm::scale in the context of zooming, since I'm not using this either.

推荐答案

通过将相机位置转换为z方向,我正在OpenGL中实现缩放效果

I'm achieving a zoom effect in OpenGL by translating the camera position into z direction

那不是Zoom,那是Dolly.缩放是视场的变化,即投影参数的变化.

That's not Zoom, that's Dolly. Zooming is the variation of the field of view, i.e. a change of the projection parameters.

如果是,哪种方法更好?

and if so, which way is better?

它们都不是完全不同的动作.您可以将Dolly和Zoom结合使用,以实现Dolly-Zoom Alfred Hitchcock出名.请访问此网站以获取摄像机运动的列表:

Neither, they're completely different movements. You can combine Dolly and Zoom to achieve that Dolly-Zoom Alfred Hitchcock got famous for. See this site for a list of camera movements:

http://www.mediacollege.com/video/shots/movement.html

这篇关于OpenGL缩放的不同方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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