DirectX SDK |
This section pertains only to application development in Visual Basic. See Direct3D Immediate Mode C/C++ Tutorials.
This tutorial explains how to draw a simple three-dimensional (3-D) scene using textures. In essence, a Direct3D texture is a bitmap of pixel colors; as a result, any bitmap image can be applied to a Direct3D primitive. Textures are a simple, powerful way to add realism to your 3-D objects without altering their geometry. In this way, textures can be used to enhance a primitive with patterns and illusions of color, roughness, transparency, and smoothness. Specifically, the Using Texture Maps tutorial explains how to create textures from file-based bitmaps and how to render a cube primitive with textures.
Note that texture handles are not used in Direct3D for Visual Basic; rather, you obtain a reference to the texture surface object when you create the texture surface
In order to add textures to the primitives in your 3-D scenes, complete the following steps:
Direct3D supports an extensive texturing feature set, providing developers with easy access to advanced texturing techniques and strategies. For more information on textures and how they can be used and optimized in Direct3D, see Textures.
Note The code in the Texture application is similar to the code in the Triangle application. This tutorial focuses only on the texturing code unique to the Texture application, and does not cover setting up Direct3D, preparing scene geometry, shutting down, or processing system events. For information on these tasks, see Tutorial 1: Rendering a Single Triangle.
The Texture tutorial draws a cube primitive. For more information on how to draw primitives, see Tutorial 3: Using_Alternate Primitive Styles.
The Texture tutorial uses enumeration to enumerate the texture formats. For more information on enumeration techniques and principles, see Tutorial 4: Using Device Enumeration.