이수안 데이터 연구실

검색 :
RSS 구독 : 글 / 댓글 / 트랙백 / 글+트랙백

글 검색 결과

Introduction to Direct 3D

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

  1. To Instantiate the DirectInput class. The DirectInput class captures all keyboard, mouse, and joystick events.
  2. To create the DirectGraphics Devices. The DirectGraphic Devices allow the application to manage system and video card resources through apis.
  3. To Create the DirectMusic class. The DirectMusic class initializes and loads music segments to be played.
  4. To Create a Timer event running at maximum speed.
  5. Insert the following source into direct3dview.cpp

이올린에 북마크하기(0) 이올린에 추천하기(0)

"OpenGL / DirectX" 카테고리의 다른 글
2007/04/29 11:14 2007/04/29 11:14

맨 위로