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, ... |
Get Beginning 3D Game Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.