O'Reilly logo

Beginning 3D Game Programming by Tom Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a Basic Particle System

You can think of a particle system as a system that generates small pieces of materials which are responding to some sort of environmental change. For example, a particle system could generate snowflakes, fog, sparks, or dust. In Tankers, you have a tank firing a projectile out of its barrel. Adding a small bit of spark particles to this firing should be easy to do.

Direct3D uses point sprites to render these particles. In the context of Direct3D, they are essentially generalizations of points in space that are rendered using textures. Adding them is also quite simple. In your project file, add a new file called specialeffects.cs and add the code from Listing 18.1 to the code file.

Listing 18.1. Starting the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required