Working with Models

Any 3D engine needs to be prepared to render 3D models. DirectX offers some default file formats and some functions that will load them in for you, but this page will talk about the basics of what you need, instead of focussing on how a particular API can handle them for you.

This discussion will focus on rigid models. That is, models that don't change their shape.

All models are made up of the following components:

Other attributes that can complicate the design of the model are as follows:

As much as possible, code to handle batch states. If the entire model does not use alpha blending, then the model rendering routine should not bother checking for it. You may code a separate routine that checks for alpha blending. Same goes for lighting.

Vertices could optionally have names attached to them. This allwos other kinds of implementations to refer to vertices by name instead of using a direct reference. Such circumstances might include the necessaity of handling glare points, such as those found on lamp posts at night. Or they could represent weapon hardpoints. Such vertices will likely have orientations attached to them as well.

Other more advanced problems are the implementation of hardpoint and galre point structures. The hardpoint system could be an entire class in itself, also requiring game obejct specific context data to handle the current state. Glare points could also have varying intensity and angle viewing aspects.

Another possibility is the implementation of thrust fire. A group of poitns and one central point (or possibly two points to represent the extremes) make up the flame and are referred to for purposes of special rendering. the flame would be animated, and the flame would certianly give off a flare point, if desired.