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: Background

What is Direct3D and what is it good for?
Where can I get Direct3D?
What are some useful things on the CD-ROM?
What are the goals of this series of articles?

What is Direct3D and what is it good for?

DirectX is a collection of high performance APIs written by Microsoft to produce sound, animation, three-dimensional graphics, etc. Direct3D is the three-dimensional graphics part of DirectX.

Before DirectX 7.0, these routine were not easily available from Visual Basic. You could use them but you had to build type libraries that defined the routines for Visual Basic. Version 7.0 includes a type library that you can include in your Visual Basic programs.

Direct3D gives you access to high-speed graphics routines without tying you to a particular type of graphics hardware. Unfortunately the routines are still relatively close to the hardware so you may need to make some hardware choices to get a program to work. For example, to use a Direct3D display adapter, the system must have one.

The discussion and examples in this series work on my system and may not work on yours without some changes. Email me and describe the changes you need make to get the programs running on your system and I'll incorporate them into the examples.

Getting a program ready to use Direct3D is a bit of a chore. Once you have it running, you'll find using Direct3D to draw three-dimensional objects surprisingly easy.

Where can I get Direct3D?

Click here to download DirectX or order it on a CD-ROM from Microsoft's Web site. The CD is packed with examples in Visual Basic and C++, a nice help file, Word documents describing some tutorials, etc. It's worth having all this stuff but I felt I didn't need it all on my hard disk so I ordered the CD-ROM. Besides, the whole package is 128 MB and who wants to spend that much time downloading?

What are some useful things on the CD-ROM?

The CD-ROM contains a lot of material so it can be a little confusing. Some particularly useful areas include:
  • \Dxf\doc\directx7\directx.chm
    This is a compiled help file containing information about DirectX 7. This is a must!

  • \Dxf\doc\directx7\word\
    This directory contains documentation about different pieces of DirectX. The file d3dim.doc contains information about using Direct3D in immediate mode, the mode these articles use. It describes several simple tutorials.

  • \Dxf\samples\multimedia\vbsamples\
    The subdirectories of this directory contain DirectX Visual Basic examples.

  • \Dxf\samples\multimedia\vbsamples\d3dim\
    The subdirectories of this directory contain Visual Basic examples using Direct3D in immediate mode, the mode these articles assume.

  • \Dxf\samples\multimedia\vbsamples\d3dim\imcontrol\
    This directory contains an ActiveX control called IMCanvas that makes it easier to use Direct3D in immediate mode. Some of the examples use this control. It is also interesting to look at how the control does certain things.

  • \Dxf\samples\multimedia\vbsamples\d3drm\
    The subdirectories of this directory contain Visual Basic examples using Direct3D in retained mode. These articles do not cover retained mode.

  • \Dxf\samples\multimedia\vbsamples\tutorials\
    The subdirectories of this directory contain the tutorials described in 3d3im.doc.

What are the goals of this series of articles?

This series shows how to get started with Direct3D. It starts with the basics, explaining how to display simple shapes. You need no background in Direct3D or graphics programming to get started. All you need a some familiarity with Visual Basic.

Later articles add more and more detail to create an interesting virtual environment. The goal toward which the articles build is a fully-interactive virtual maze game complete with textured walls, doors, objects for the player to collect, and enemies to fight. Once you know how to build this kind of environment, the sky's the limit!

After you have had a chance to expand on the basic program, email me so I can share your innovations with others. Together we should be able to build a game that rivals the commercial products that have recently swept the country.

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.