如何调整视图大小时如何停止对象的缩放效果 [英] How Do I Stop Zooming Effect On Objects When View Is Being Resized

查看:75
本文介绍了如何调整视图大小时如何停止对象的缩放效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调整窗口/视图的大小时,对象往往会放大和缩小。我希望在没有这种效果的情况下显示对象。因此,当我缩小窗口时,对象不应缩小,反之亦然。我已经尝试使用backbuffer重置设备(具有新的窗口大小),但它没有帮助。我错过了任何需要做的事吗?

如果任何人都可以提出任何解决方案那将是很好的。

On resizing of window/view, the objects tends to zoom in and out. I want the objects to be shown without this effect. So when i shrink the window the object should not shrink and vice versa. I have tried resetting the device with backbuffer (having new window size) but it is not helping. Am i missing anything that needs to be done?
It would be of great if any one can suggest any solution.

推荐答案

有(至少)你可以做两件事。



第一种是调整摄像机位置以补偿屏幕大小的变化。如果在窗口大小加倍时相对于观察对象的摄像机位置不变,则对象的外观尺寸也会加倍,但如果将摄像机向后移动,则可以对此进行补偿。这种方法具有实际改变观点的缺点,这可能是也可能不是你想要的。



另一种方法是渲染到虚拟表面然后渲染表面未缩放到屏幕。这要求用于摄像机的视口独立于窗口的大小,如果虚拟表面的大小小于窗口的大小,则可能看起来很奇怪。
There's (at least) two things you can do.

The first is to adjust the camera position to compensate for the change in size of the screen. If the camera position relative the observed object is unchanged when the window size is doubled, the apparent size of the object will also double, but if you move the camera back you can compensate for this. This approach has the downside of actually changing the point of view, which may or may not be what you want.

Another approach is to render to a virtual surface and then render that surface unscaled to the screen. This requires the view port used for the camera to be independent of the size of the window and might look weird if the size of the virtual surface is smaller than the size of the window.


这篇关于如何调整视图大小时如何停止对象的缩放效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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