Introduction
Direct3D is a group of Microsoft Api that allows the developer to control a 3D environment. The 3D environment processes vertexes through the Geometry pipeline. Step 1 transforms the vertexes into the World coordinates, step 2 applies camera matrices to the vertex, step 3 applies projection matrices that transform the vertex for a 3D coordinate to a 2D coordinate, and the 2D coordinate is normalized to window coordinates (this is mapping the viewport to the window).
In this tutorial we will use one of three objects: 1. A triangle with normals 2. A tiger loaded from a direct.x file 3. A cylinder calculated from an equation.
All the 3D code is encapsulated in the D3DEngine class. All music segment is defined in the DXMusic class. The DirectInput will be managed by CDX. For more information on CDX click here.
Project Generation
Project Generation
- Press File
- Press New
- Select "Project Workspace"
- Select MFC Application
- Call the project "Direct3D"
- Step 1 select "Multiple Document"
- Press Next
- Step 2 Press Next
- Step 3 Press Next
- Step 4 Press Next
- Step 5 Press Next
- Step 6 Press Finish and Ok
Implementing the DirectSound,Direct3D,DirectInput classes
Step 1: Add the following header and pragma defines to direct3dview.cpp
Step 2: Create a Method called ProcessGeometry. Add void ProcessGeometry to the direct3dview.h file. Insert source into direct3dview.cpp
Step 3: Use the Class Wizard to build a message map method for OnInitialUpdate for the following reasons
- To Instantiate the DirectInput class. The DirectInput class captures all keyboard, mouse, and joystick events.
- To create the DirectGraphics Devices. The DirectGraphic Devices allow the application to manage system and video card resources through apis.
- To Create the DirectMusic class. The DirectMusic class initializes and loads music segments to be played.
- To Create a Timer event running at maximum speed.
- Insert the following source into direct3dview.cpp



















