zoukankan      html  css  js  c++  java
  • 如何修正导入模型的旋转? How do I fix the rotation of an imported model?

    原地址:http://game.ceeger.com/Manual/HOWTO-FixZAxisIsUp.html

    Some 3D art packages export their models so that the z-axis faces upward. Most of the standard scripts in Unity assume that the y-axis represents up in your 3D world. It is usually easier to fix the rotation in Unity than to modify the scripts to make things fit.

    一些3D制作包导出的模型是Z轴向上的,在Unity中大多数标准脚本,假设Y轴在3D世界中表示向上的。在Unity中非常容易修正旋转而不用修改脚本。

    Your model with z-axis points upwards 你的模型是Z轴向上

    If at all possible it is recommended that you fix the model in your 3D modelling application to have the y-axis face upwards before exporting.

    如果有可能,建议你在导出前在3D建模软件中修正模型以便使Y轴向上。

    If this is not possible, you can fix it in Unity by adding an extra parent transform:

    如果做不到这一点,你可以在Unity中添加额外的父变换来修正它。

    1. Create an empty GameObject using the GameObject->Create Empty menu 
      使用GameObject->Create Empty菜单创建一个空的GameObject(游戏物体)
    2. Position the new GameObject so that it is at the center of your mesh or whichever point you want your object to rotate around. 
      定位这个新的游戏对象,使他位于网格的中心或者想要物体围绕旋转的点上
    3. Drag the mesh onto the empty GameObject 
      拖拽网格到这个空的游戏对象上

    You have now made your mesh a Child of an empty GameObject with the correct orientation. Whenever writing scripts that make use of the y-axis as up, attach them to the Parent empty GameObject.

    现在你已经将网格作为一个具有正确方向的游戏对象的子物体了,写脚本的时候使用Y轴向上,并将他们附加给这个空的父物体上。

    The model with an extra empty transform 带有一个额外空变换的模型

  • 相关阅读:
    cocos2d tiledmap
    cocos2d 例子编辑器
    cocos2d 粒子系统
    【leetcode】矩阵中的幸运数
    【leetcode】魔术索引
    【leetcode】多数元素
    【leetcode】整理字符串
    【leetcode】通过翻转子数组使两个数组相等
    【leetcode】珠玑妙算
    【leetcode】距离顺序排列矩阵单元格
  • 原文地址:https://www.cnblogs.com/123ing/p/3816201.html
Copyright © 2011-2022 走看看