Direct3D (DirectX 8.1) Code Samples - Page 3

View Matrix
 

Demonstrates how to manually modify the view matrix using mouse and keyboard input to create a game style motion control. This sample is very similar to the "First-Person-Shooter View Control" sample except this one uses no DirectInput. Check out the OpenGL source code page for the OpenGL equivalent of this sample.

 

Lighting
 

This sample demonstrates the three basic types of lights that are available in Direct3D: directional, spot, and point. Check out the OpenGL source code page for the OpenGL equivalent of this sample.

 

Point Sprites
 

This sample demonstrates how to use point sprites with Direct3D. Point sprites are hardware-accelerated billboards, which are capable of being textured. Point sprites are ideal for creating high-performance particle systems because you only have to send a single vertex point or point sprite for each particle instead of four vertices for a regular billboarded quad. Point sprites also do all the math involved in view aligning the final quad on the GPU instead of the CPU. See the Particle System sample on this page for a more complex example of their usage. Check out the OpenGL source code page for the OpenGL equivalent of this sample.

 

Particle System (Using Point Sprites)
 

Adding a particle system to your game engine has become all the rage, but where do you start? Here of course! This sample demonstrates how to create a particle system class which uses Direct3D's hardware accelerated point sprites. To learn more about point sprites, check out the Point Sprites sample on this page. Check out the OpenGL source code page for the OpenGL equivalent of this sample.

 

Building a Look-At Matrix
 

This sample shows you how you can use an eye position in world space, an up vector, and a look-at point to create a proper view matrix for Direct3D.