O'Reilly logo

Beginning 3D Game Programming by Tom Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering Your 3D Model with Your User Interface

You've already loaded 3D meshes in your games up to this point, and in Blockers, you actually did something similar to what you'll do here, but there you had the mesh a part of the user interface screen itself, rather than its own separate object. Add a new code file called tank.cs to your project, and add the code from Listing 12.13 to that file.

Listing 12.13. The Tank Selection Model
 using System; using System.Drawing; using System.Windows.Forms; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; using Microsoft.Samples.DirectX.UtilityToolkit; namespace Tankers { /// <summary> /// Will hold the possible tank colors /// </summary> public enum TankColors : byte { Gray, Black, Green, Sand, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required