Game Development Reference
In-Depth Information
Figure 3-12. Importing and checking 3D content with the Delta Engine ContentManager
For the Labyrinth game, currently just the following content is used:
An extra GroundDiffuse texture for the ground plane
The Box, Dragon, Spikeball, and Wall meshes each with their material data and used diffuse
map texture
Because we tested the different FBX exporters of 3ds Max, Maya, and Blender, the 3D models have different up
axis setup. It is important to note that even when exporting an FBX file with Z up, the 3D data will be saved in the
original format (e.g., with Y up when it comes from Maya). In order to fix that, we used a little helper method
(see Listing 3-1 for some sample code) to convert all vertices and normals by switching Y and Z around and then
negating Z. This works okay for static geometry, but it might cause problems for more complex geometry and
animations. These issues can be fixed as well, but more testing and tweaking is usually required.
Listing 3-1. A Helper Method for Converting Vertices and Normals when Exporting an FBX File
/// <summary>
/// In case the scene was created with Y-Up originally
/// we need to convert it to Z-Up space by switching Y and Z
/// around and negating Z.
/// </summary>
public static void ConvertYUpAxisToZUpAxis(
ComplexVertex[] vertices)
Search WWH ::




Custom Search