Visual Basic Explorer
Visual Basic Explorer
 Navigation
 Home


 Coding
 Source Code

 FAQ Center

 VB Tips

 Downloads

 ToolBox

 Tutorials

 VB Games

 VB News

 VB Award

 VB Forums



 Affiliates
 Planet Source Code

 Rent a Coder

 DirectX4VB


 Misc
 Search

 Feedback

 Advertise

 About


Need to hire
a VB coder?

Please support our sponsor:

 Home 
 Site Map 
 Forums 
 News 
 Feedback 

Using Direct3D with VB

By Rod Stephens

Direct3D: Good Coordination

This article explains the coordinate system Direct3D uses. You need to understand this system to draw three-dimensional objects.

There are several ways you might arrange the X, Y, and Z coordinate axes in three-dimensional space. Direct3D uses the left-handed coordinate system shown in Figure 1.

Figure 1. The left-handed coordinate system used by Direct3D.

This system is called "left-handed" because you can use your left hand to remember which way the Z-axis points relative to the X- and Y-axes. Line your left wrist up with the origin, placing your fingers along the positive X-axis so they curl towards the positive Y-axis. If they curl towards the negative Y-axis, you need to flip your hand over. When your hand is in the right position, your thumb points towards the positive Z-axis.

It is usually helpful to think of the axes arranged as they are shown in Figure 1. Here the X- and Y-axes are parallel to the computer monitor and the Z-axis goes back into the screen. You are sitting at some point with a positive Z coordinate.

In many programs, it is convenient to place the objects you are drawing around the origin (0, 0, 0). You position the viewing position at (0, 0, -Z) for some negative Z value looking back towards the origin. The viewing position is also called the point of view, the POV, or the camera position.

Often that is just the start and objects or the viewing position or both get moved when the program runs. The later articles Making a Scene and Simply Amazing demonstrate these techniques.

Still, it can be very handy to think about your objects in these terms. It's also quite useful to draw a little diagram on paper before you start trying to create objects in code. When you need to orient triangles, a technique described in Getting Started, a diagram can save you hours of frustration.

Back to Direct3D Introduction





Home | About | What's New | Source Code | FAQ | Tips & Tricks | Downloads | ToolBox | Tutorials | Game Programming | VB Award | Search | VB Forums | Feedback | VBNews | Copyright & Disclaimer | Advertise | Privacy Policy |

Quick searches: Site Search | Advanced Site Search 

Copyright 2002 by Exhedra Solutions, Inc.
By using this site you agree to its terms and conditions
VB Explorer and VBExplorer.com are trademarks of Exhedra Solutions, Inc.