Unity Camera Orthographic Size

关于 Camera的Orthographic 中的size大小问题,默认为5 units,(5个单位)。
在这里插入图片描述
首先5是什么意思呢?
That magic number is the number of units from the center half of the screen to the top, or bottom.
也就是 5x2 = 10,说明你的窗口的高为10个units.这样就好理解了。
怎么样与Unity的像素想关联呢?
在这里插入图片描述
如果我们把一张图片转换为 Sprite(2D and UI),你会看到 Pixels Per Unit 100,默认位100个pixels 为1个 Units。

如果我们把图片100改为128。我们用一张128x128像素的图来测试。
在这里插入图片描述
这样,我们在默认的 Orthographic下的Size为5,也就是高为10个单位,如果1一个单位为128像素的话,用10张像素为128的,就可以填满整个屏幕的高了。

在这里插入图片描述
What this will do is convert 1 pixel from that sprite into 1 Unity3D Unit. This means if your sprite is 50px in height, in world space it is now 50 units in height. We need to fix this and we’re going to do this with the Orthographic Size in the Camera。
当然,如果你想要和像素点相互对应,那么比如,如果你在1920X1080下做,你可以把 Orthographic下的Size 设置为 1080 / 2 = 540.
并且把图片的 pixels per units 设置为 1 。这样,你的像素单位就对应了。 ps: 怎么感觉用英文描述比较清晰呢?难怪我语文不及格!


本文来自 一曲无容丿 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/u011473031/article/details/50846751?utm_source=copy

猜你喜欢

转载自blog.csdn.net/vc43vc/article/details/82940332
今日推荐