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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值