Importing Models Exported from DCC Tools
Because the coordinate system of the DCC tool and the game engine’s coordinate system are not necessarily the same, some transformations are required when exporting a model to get the desired result in the engine. For example, Blender’s coordinate system is X-axis right, Y-axis inward, and Z-axis upward, while Cocos Creator 3.x’s coordinate system is X-axis right, Y-axis upward, and Z-axis outward, so the rotation needs to be adjusted to make the axes consistent.
The following uses Blender 2.8 as an example to introduce the model import process. First, create a model in Blender.
In documentation, choose Up as Y Up and Forward as -Z Forward.
To use a different rotation value, Blender’s FBX export plugin provides an experimental function, Apply Transform, which can directly transform the rotation data into the model’s vertex data.
Notice that the rotation data is gone in Cocos Creator 3.x.
Options for exporting glTF in Blender. It is relatively simple, as long as the +Y Up option is checked, there is no rotation value in the exported data.
During the game development process, the orientation of the model may be used. For example, if some objects should face the player (using the method), consider the initial orientation of the model. Here are two methods to adjust the initial orientation of the model.
- In Cocos Creator 3.x, the -Z-axis is used as the forward direction, while in Blender, the forward direction is +Y-axis, when making a model, the positive direction of the Y-axis should be used as the orientation of the object, and the derived transformation later, in Cocos Creator, the -Z-axis will be used as the front direction.
Reasonably formulating a sub-assets name under model assets (e.g mesh or material). Each modification of the sub-assets name will result in the loss of the place associated with the sub-assets in the project.
When a part of the model needs to be transparent and a part does not need to be transparent, it should be exported into two materials. If it is a material export that is prone to model penetration, you need to manually adjust the material.