3D Models - GameLabGraz/Maroon GitHub Wiki


Notable reusable 3d-models

References

The folder 3d-models/Reference contains reference models for model size and rotation. They can be used for orienting and scaling other models. The models have a corresponding prefab in the folder unity/Assets/0Refactored/reusablePrefabs/reference. After they are placed in a scene or prefab and making sure they have a scale factor of 1 and are not rotated, they can be used as a reference for the rotation and size of other models.


Scaling

Unity works with arbitrary units. The default physics work on the assumption that one unit is one meter. The VR-setup also assumes that one unit is one meter. Therefore all models should be designed in such a way that one unit is equal to one meter.

Here is a checklist for correct model scaling:

  • The model was created in life size
  • The model is exported to FBX with a scaling factor of one
  • It is imported into Unity with a scaling factor of one
  • It is placed in a scene with a scaling factor of one
  • The model has the correct size for a VR-Player with a scaling factor of one

Rotation

Unity uses a left-handed coordinate system. Blender uses a right-handed one. Therefore a conversation is needed when importing from Blender to Unity. Models should be created in such a way that they respect the rotation conventions.

Blender rotation convention:

Direction Color Interpretation
Positive X Red Left
Positive Y Green Backwards
Positive Z Blue Up

Unity rotation convention:

Direction Color Interpretation
Positive X Red Right
Positive Y Green Up
Positive Z Blue Forward

Origin

The origin of a model should be chosen to make it as easy as possible to place the object in a scene. For example, if the object is a lamp that is mounted to the ceiling the origin should be in the middle of the part of the lamp that touches the ceiling. If the object is a door the origin should be at height 0, forward 0 and in the middle of the width, so that the door can be easily placed to touch the wall and floor.


Exporting from Blender and importing into Unity

In order to prevent import issues during version upgrades all models should be included via FBX. Blender and other 3d-model files should not be placed inside the unity folder.

Blender steps

  • The model is modeled in the correct scale, if not, scale the model accordingly

  • The origin of the model is placed in an appropriate spot

  • Check if the transform settings are correct (in object mode)

    • The location of the model has to be (0, 0, 0)
    • The rotation has to be (0, 0, 0)
    • The scale has to be (1, 1, 1)
    • If this is not the case use CTRL + A and select All transforms
  • The model has to be oriented in along the Y-axis, with the front pointing in the negative Y direction

  • The top of the model has to point in the positive Z direction

  • Delete all unwanted objects such as cameras or lights, or select only the objects that should be exported

  • If the model is a simple model without animations/armatures

    • Open the FBX exporter
    • If the desired objects are selected, select the option Selected Objects
    • Set Apply Scalings to All Local
    • Select the option Apply Transform
    • Export FBX file
  • If the model has animations/armatures

    • Rotate the object along the X axis: -90 degrees
    • Use CTRL + A, select Rotation
    • Rotate the object along the X axis: 90 degrees
    • Do not apply the rotation this time
    • Open the FBX exporter
    • If the desired objects are selected, select the option Selected Objects
    • Set Apply Scalings to FBX Units Scale
    • Uncheck Apply Transform
    • Export FBX file

Unity steps

  • Import FBX file

A good tutorial is available here:
https://www.immersivelimit.com/tutorials/blender-to-unity-export-correct-scale-rotation


Note: There is a blender script planned that automates the steps