官术网_书友最值得收藏!

A few observations

The back of the cube is facing us. Is that a mistake? Actually, it makes sense since the current viewpoint is looking forward. So, we should see the back of the cube. If you didn't notice already, the same goes for Ethan. It also seems like the cube has a one-unit dimension.

However, on closer examination, in the cube's Inspector panel, you'll see it imported with the scale that we gave it in Blender (0.5, 0.5, 0.5). Also, it has an rotation of -90 (minus 90). Thus, if we reset the transform, that is, the scale to (1,1,1), it'll be 2 units in our world space and tipped over (so, don't reset it).

There's not much that we can do to compensate for the rotational adjustment without going back to Blender. But the scale can be adjusted in the model's Import Settings (in Inspector).

Blender's default up direction is Z, while Unity's is Y. Importing with a -90 rotation adjusts for that. An imported scale can be adjusted in the object's Inspector panel's Import Settings.

We have more control when it comes to exporting FBX from Blender. As shown in the screenshot, during Export you can customize the settings, for example, making Y the up axis and Z the forward one and setting the scale factor for import:

Before ending the preceding process, select UprightCube from the Hierarchy panel and drag it into the Project panel's Assets folder. (You may consider making an Assets/Prefabs subfolder and placing it into that.) This makes it a reusable prefab, texture image and all.

There are some important lessons in this exercise (other than having learned a little bit about Blender) that apply to any 3D Unity project, including the VR ones. Normally, you will be importing models that are much more complex than a cube. You will likely run into issues related to data conversion, scale, orientation, and UV texture images that might be confusing at best. If this happens, try to break the problem into smaller, more isolated scenarios. Do little tests to gain insight into how applications exchange data and to help you understand which parameter tweaks might be necessary.

主站蜘蛛池模板: 清水河县| 正定县| 鄂伦春自治旗| 邵阳市| 屯门区| 汤阴县| 兰坪| 龙川县| 察哈| 铜山县| 兴山县| 玉门市| 陈巴尔虎旗| 陇南市| 壶关县| 南召县| 永城市| 溆浦县| 金堂县| 定州市| 淮南市| 浦江县| 奈曼旗| 辽宁省| 成都市| 濮阳县| 盐边县| 调兵山市| 龙海市| 山东省| 井冈山市| 饶河县| 镇安县| 泰顺县| 哈巴河县| 外汇| 高州市| 利川市| 伊宁县| 丰原市| 绍兴市|