Csharp.net Tutorial: Drawing Particles with Truevision 3D

James Cloud
Introduction

Games use particles for smoke, fire, sparks, and a number of other special effects. If you want to add some colors and effects into your project this tutorial will show you how by make use of particle effects. With the Truevision 3D game engine you can create and draw particles with minimal coding.

Before you start following this guide, start up the particle editor that comes with the Truevision engine and make your particles using this editor. Once your finished and have exported your new particle to a TVP file, begin at step one below.

Step One - Definitionand Loading

To load and render TVP particle files you will only need to make one definition, that is, of course, assuming you have already made reference to the Truevision 3D game engine library. For each particle file you want to load add this code to your project's object declarations,

TVParticleSystem myParticle;

and then place this code into your loading function,

myParticle = Scene.CreateParticleSystem();

Replace myParticle with whatever you would like to call your new particle object. Now that the particle object is defined you can load the Truevision particle file that your created earlier in the particle editor. Here is the code to load the particle file,

myParticle.Load(Application.StartupPath + "\\Particles\\myParticle.TVP");

That's all there is to loading a TVP particle file, now to render the actual particles, continue to step two.

Step Two - Drawing and Rendering

Rendering the new particle object is easier and simpler than loading the original object. In your game's render code block simply call the particle object's render method like so,

myParticle.Render();

Make sure to go through all the available settings and methods in the Truevision particle system to fully customize and utilize the object to your desires and needs.

Note: This tutorial was made using Truevision 3D Engine 6.5 full install.

Published by James Cloud

I like to program and do basically anything that has to do with technology and computers.  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.