Loading a static mesh from a file

In this recipe, we will create a mesh renderer that renders meshes loaded from a compiled mesh object (.CMO) file. We will use the Visual Studio graphics content pipeline to compile an Autodesk FBX model that has been exported from the open source 3D modeling and animation software, Blender (blender.org).

The class Common.Mesh within the provided sample framework will be used to load the .CMO file format and to store the loaded mesh. The loaded mesh will contain the vertex and index buffers along with material and lighting parameters and can also include the name of textures and pixel shaders to use.

Getting ready

This recipe assumes that a right-handed coordinate system is being used; see the previous recipe,

Get Direct3D Rendering Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.