简体   繁体   English

使3d立方体统一看起来像2d矩形

[英]make the 3d cube to look like a 2d rectangle in unity

How can I make a 3d cube with invisible walls but visible surface (the down and the inner surface which is on the ground) in unity 3D? 如何以统一3D制作具有不可见墙壁但可见表面(地面的下表面和内表面)的3d立方体? I mean I want the 3d cube to look like a 2d rectangle. 我的意思是我希望3d立方体看起来像2d矩形。

Changing one of the Vector3 scale values (x, y or z) to a low number (0.001) will make it look like a 2d rectangle. 将Vector3比例值之一(x,y或z)更改为较小的数字(0.001)将使其看起来像一个2d矩形。

First example below is an unaltered cube, and the next is the same cube with the x scale value lowered to 0.001. 下面的第一个示例是一个不变的多维数据集,下一个是x比例值降低到0.001的相同多维数据集。

不变的立方体 低x值多维数据集

Note: this does not make the sides invisible . 注意:这不会使侧面不可见

Waning: This method is more resource consuming . 减弱:此方法消耗更多资源 If you want to make the sides invisible, you could create your own cube using 6 2d squares (which you can do by going to the Project Folder > Create > Sprites > Square ). 如果要使侧面不可见,则可以使用6个2d正方形来创建自己的立方体(可以通过转到Project Folder> Create> Sprites> Square来完成 )。 Then making all of them invisible by disabling Mesh Renderer component on them (except for the one 2d rectangle you want to stay visible). 然后通过禁用它们上的“ Mesh Renderer”组件使它们全部不可见(除了一个要保持可见的2d矩形)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM