수안이의 컴퓨터 연구실

  • Mainpage
  • About Me
  • Tags
  • Metapage
  • Notice
  • Location
  • Keywords
  • Guestbook
  • Admin
  • Write an Article
  • Total | 1691135
  • Today | 441
  • Yesterday | 628

1 Articles, Search for 'Direct 3D'

  1. 2007/04/29 Introduction to Direct 3D
Programming/OpenGL / DirectX2007/04/29 11:14

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

Add the following source into direct3dview.h

  1. The include directivs for the directinput, direct3d, and directmusic
  2. Class variables for directinput, direct3d, and directmusic



Step 4 Add Source code to the WM_TIMER method OnTimer

  1. Arrow key events control camera movement
  2. Keys 1 and 2 play music segments



Defining the Direct3D class

The constructor initializes the direct3D interfaces to NULL. It creates a Matrix Stack variable. Matrix Stacks allow the developer to create hierarchial transformation trees
by using push and pop methods. For the current matrix the developer call apply local transformations which rotate, scale, or translate from the objects local coordinate axis or the developer can elect to select tranformations relative from the parent matrix. All matrix multiplication is accumulative, so parent tranformations apply to the children.

  • The BuildSceneGraph,TraverseSceneGraph, and CleanupSceneGraph are used to build a hierarchial tree, traverse it and run mapped functions (DrawObject1,DrawObject2,DrawObject3), and cleanup the scenegraph when the base class is destroyed.
  • The InitializeEngine creates the Direct3d object, gets the current desktop display mode, create the direct3d device which allows control of video card resources.
  • The InitializeGeometry, InitializeGeometry2, and LoadTigerModel create data structures that contain vertex information. The vertex information is streamed to one of two vertex buffers used to by DrawObject1, DrawObject2, or DrawObject3.
  • The SetEnvironment method trues on Z buffering, enables Back Face Removal, and calls InitializeGeometry, InitializeGeometry2, and LoadTigerModel.
  • The Render method clears both the backbuffer and zbuffer; begins the scene; sets up the world, view, and project matrixes, and traverses the scenegraph; and ends the scene.

"OpenGL / DirectX" 카테고리의 다른 글
  • Introduction to Direct 3D (0)2007/04/29
  • Direct X (Direct Draw3) (0)2007/04/05
  • Direct X (Direct Draw2) (0)2007/04/05
  • Direct X (Direct Draw) (0)2007/04/05
  • 얼굴인식의 구현과 유사도 판단-5 (0)2005/09/14
2007/04/29 11:14 2007/04/29 11:14
Posted by webdizen
Tags Direct 3D
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/2864

Leave your greetings.

[로그인][오픈아이디란?]

«Prev  1  Next»

RSS HanRSS
Blog Image
webdizen
이곳은 컴퓨터에 대해 연구하고, 공유하고, 소통하기 위한 연구실입니다. 개인적으로는 OLAP, Data Mining, Semantic Web, Data Modeling에 대해서 연구하고 있습니다.

Categories

전체 (3009)
Webdizen (141)
Life (6)
Diary (16)
Blog (9)
IDEA (2)
Travel (10)
Book (16)
Photo (7)
Movie (8)
Music (14)
Leisure Sports (10)
Funny (6)
Hardware (121)
Software (120)
Windows (5)
Unix & Linux (120)
Installation (5)
Kernel (10)
System (34)
Develop (22)
X-Window (0)
Applicaton (31)
Security (4)
Framework (2)
Hadoop (2)
Programming (804)
Algorithm & Data Structure (1)
Assembly (38)
UNIX/Linux C (95)
C++ (128)
STL (4)
Java (38)
Win32 API (92)
ATL/COM (44)
MFC (151)
.NET (26)
WCF/WPF (4)
C# (28)
Network Programming (17)
Database Programming (12)
OpenGL / DirectX (13)
Multimedia Programming (0)
Game Programming (21)
Parallel Distributed Progra... (0)
Reverse Engineering (0)
Debugging (9)
Python (1)
Ruby (1)
Ruby on Rails (1)
QT (4)
GTK (0)
JSP (0)
PHP (6)
ASP.NET (6)
ASP (2)
Development (28)
Useful Library (2)
Data Modeling (0)
Database (105)
Oracle (4)
MSSQL (41)
MySQL (2)
Data Warehouse (2)
Data Mining (4)
Network (66)
Web (79)
DHTML (4)
XHTML (1)
Javascript (1)
CSS (1)
AJAX (9)
XML (11)
Flex (1)
Silverlight (3)
Security (91)
DoS (1)
Kernel (10)
Scanning (3)
Sniffing (0)
Spoofing (4)
Overflow (28)
Web (11)
Shell (10)
Format String (14)
Window (2)
Embedded (70)
Multimedia (27)
Mobile (14)
Graphic (24)
Management (633)
Knowledge (581)
Hadoop (0)

Notice

  • 메타 블로그 사이트에 등록
  • 새해 맞이 블로그의 변화
  • 블로그 명칭 변경
  • 도메인(www.webdizen.net) 구...
  • TEXTCUBE 1.6.1로 업그레이드...

Tags

  • Firefox
  • 세션빈
  • file
  • console
  • Registry
  • pthread
  • 웹
  • WDSL
  • 강원대학교 사범대학 부설고등학교
  • KBS
  • 파일 I/O
  • 연쇄살인범
  • FastCGI
  • JsUnit
  • 접속 로그
  • 사이클로이드
  • 까무스 XO
  • Secure
  • WebTool
  • SASS

Recent Articles

  • 트위터(Twitter)의 시작!.
  • 청년 리더의 조건.
  • 애플의 타블렛 PC - 아이패드....
  • 미래의 인터페이스 - 육감 기....
  • 기초발성법 동영상 강좌.

Recent Comments

  • 관리자만 볼 수 있는 댓글입....
    비밀방문자 03/12
  • 상대방의 이야기를 열심히 경....
    DoNuts 03/03
  • Lots of students know techn....
    Bobbi35Shannon 02/25
  • 좋은글 잘 보고 갑니다..
    Und_hacker 01/08
  • 재밌네요~ 첫번째꺼는 요즘....
    Hybrid 2009

Recent Trackbacks

  • printf,scanf를 이용한 형식....
    yundream의 프로그래밍 이야기 03/10
  • 파일 열기/저장하기 CFileDialog.
    은마군의 나태블록 2009
  • World IT Show 2008.
    상우 :: Oranzie's BLOG 2008
  • cvs서버 설치하기.
    3인3색 2008
  • 속속 공개되는 Google Chart....
    PHP와 Web 2.0 2007

Archive

  • 2010/02 (1)
  • 2010/01 (6)
  • 2009/12 (5)
  • 2009/09 (3)
  • 2009/08 (1)

Calendar

«   2010/03   »
일 월 화 수 목 금 토
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Bookmarks

    • Administration
      • IIS.NET
      • NTFAQ
      • OS의 모든 것
      • 리눅스포털
    • Database
      • SQL Server Central
      • SQL Team
    • Development
      • .NET Heaven
      • ASP Alliance
      • ASP.NET 2.0
      • Bullog.net
      • C# Corner
      • C++ (C PlusPlus.com)
      • C++ Reference
      • CodeGuru
      • CodePlex
      • DebugLab
      • Dev Articles
      • Devpia
      • DotNet Junkies
      • DotNet Zone
      • Driver Online
      • GOSU.NET
      • HOONS 닷넷
      • Joinc 팀블로그
      • KOSR
      • MSDN Home Page
      • OSR Online
      • Sky.ph - 개발자 커뮤니...
      • TAEYO.NET
      • The Code Project
      • WindowsClient.net
      • 김상욱의 개발자 Side
      • 조인시 위키
    • Human Networks
      • belief21c's e-space
      • I think I can
      • Invisible Rover's Blog :D
      • Rodman®
      • ■ Feel So Good~! ■
      • 까만 나비
      • 나를 가꾸는 시간.
      • 나만의 즐거움~~!
      • 단녕
      • 상우 :: Oranzie's BLOG
    • Information Technology
      • Microsoft TechNet
      • 지디넷코리아 - 글로벌...
    • Security
      • FoundStone
      • milw0rm
      • NewOrder
      • OpenRCE
      • Phrack.org
      • Reverse Engineering b1...
      • Reverse Engineering Team
      • RootKit
      • SecurityFocus
      • SecurityXploded by Nag...
      • Wow Hacker
      • Zone-H
Textcube
Louice Studio Inc.
Powered by Textcube. Original designed by Tistory.