------

[ AD ] Port Monitor ( Try to use a Best WebSite Monitoring Tool )

------

Prerequisite

Before you can do this tutorial, you will need the following:

1.  Visual Studio 2005 (or Visual C++ 2005 Express Edition)*.
2.  A knowledge of basic C++ and Win32 programming.
3.  DirectX SDK (February 2005 or later)
4.  A burning desire to make games.

 

* - other versions of C++ compilers will also run DirectX, however, there are some language specific changes you may need to make in each of the demo applications.

 

In this first DirectX lesson we will go over how to build a basic Direct3D application.  We will also cover a couple of theoretical concepts underlying DirectX which are useful to know.  Don't worry, nothing too theoretical.

 

1.  Create global variables and function prototypes
2.  Create a function to initialize Direct3D and create the Direct3D Device
3.  Create a function to render a frame
4.  Create a function to close Direct3D

 

 

d3d->CreateDevice()

d3d->Release()

 

#include <d3d9.h>

 

#pragma comment (lib, "d3d9.lib")

 

LPDIRECT3D9 d3d;

LPDIRECT3DDEVICE9 d3ddev;

 

 

 

Imagine only being able to play Half-Life 2 or Halo in a 400x400 pixel window.  Kinda lame?  I thought so myself.  In this lesson we will modify our Direct3D program to be in Fullscreen mode.

More important than knowing the code of Direct3D is having a very fundamental understanding of 3D and how it works.  This lesson will go briefly over 3D coordinate systems, how 3D models are constructed, lighting, color and more.  If you already know these things, I recommed you go over this to make sure there isn't anything else you might learn.  Otherwise, you should do this lesson in full.

Triangles do not make the world go round.  They are the world.  Because triangles can be combined to form pretty much any shape known to man, games tend to be made out of triangles.  In this lesson we will learn how to draw a simple triangle and color it.

So far, our triangle does nothing.  It sits still, and even if you got it to move, it wasn't in 3D.  You made a boring, flat triangle.  Now let's bring this triangle to life by transforming it into a 3D triangle, rotating it, moving it around, and even scaling it to a different size.

Now our triangle can rotate, can be resized and can move.  Our camera can zoom, pan, and change direction.  We've got everything set to go.  However, there is one problem that must be solved before we go too far...

We're getting pretty good with triangles, but triangles by themselves are no fun.  Let's learn how to make simple shapes out of triangles, and transform each shape as a whole.

In the previous lessons we have turned lighting off for simplicity.  However, no lights in a 3D world makes everything look fake.  Lights add good effects to your game, even if they are as simple as day and night.  This lesson will cover the basics of lighting and show how to make a simple light.

There is more to lighting than a simple Directional Light.  This lesson covers more types of lights you can use.

Sometimes you wish to have objects be see-through.  This includes windows, glass objects, clouds, and much more.  These effects are achieved by blending colors together, the color of what you are drawing and what is in the background.  This lesson will cover how to do simple color blending.

'온라인게임 > DirectX' 카테고리의 다른 글

SlimDX  (0) 2010.10.07
Lesson 2 - 풀 스크린 만들기  (0) 2010.09.03

+ Recent posts