A system of particles

Xtreme3D

Lesson 17
A system of particles

Level: medium
Version of the Xtreme3D: 3.0.x
Author: Gecko

Particles (particles) is a small, simple in form of moving objects, a lot of which simulates various complex dynamic substance, for example, fire, smoke, fireworks, etc. As the particles in the game engines are typically used billboards - toward the camera with the rectangle texture. In the Xtreme3D there are two different systems of particles - FireFX and ThorFX. FireFX - the system of particles, modeling fire (although you can use it to recreate and various other effects). ThorFX is designed for the simulation of lightning and various kinds of electric discharges.

In the games is typically used many similar systems of particles. For example, in a cave on the walls can hang torches, and each will burn the fire, made with the help of particles. In this case, the easier it is not to create a separate system for each of the spray, and just draw a one and the same system several times in different positions. Specifically for such a situation, a manager of The FireFX. Manager - this is something like "server" running all the calculations related to the effect. A separate system of FireFX is "customers", using settings specified for the manager. You simply create a manager, configure it as you want, and then add any number of systems in all the right places you in the scene. The changes made to the manager settings will automatically affect all their reporting systems.

First, create The FireFX manager:

Firefx FireFXManagerCreate =();
FireFXSetParticleSize(firefx, 0.3);
FireFXSetRadius(firefx, 0.1);
FireFXSetBurst(firefx, 2.0);
FireFXSetDensity(firefx, 1);
FireFXSetLife(firefx, 1);
FireFXSetColor(firefx, c_yellow, 1.0, c_red, 0.0);

You will now add the effect of fire any objects in any quantity:

Fireobj1 = DummycubeCreate(global.scene1);
ObjectSetPosition(fireobj1, 2, 0, 0).
FireFXCreate(firefx, fireobj1);

Fireobj2 = DummycubeCreate(global.scene1);
ObjectSetPosition(fireobj2, 2, 0, 0).
FireFXCreate(firefx, fireobj2);