|
Introduction
This demo doesn't use any advanced function, but it is here to demonstrate
my newly written class TParticles and class TMiniPhysics.
In short, TParticles is specialized in generating, killing and rendering the particles.
During generation, each particles is given dimensions, a speed and direction and
a certain lifetime.
TMiniPhysics handles the physics going on in a scene. It only handles acceleration, speed
and collision detection. Having friction (with air, with objects) would be nice but I left it
out for now. Having a good physics engine is not easy, so that is why I call it "Mini".
No source code provided. Only EXE file.
How To Use
Use the right mouse button to access the context menu.
In this menu, there is :
- Setup Dialog...
- Black Background
- White Background
- Grey Background
- About...
Click on "Setup Dialog...". You will see that there are many options :
- Point source of emission (x, y, z value from where the particles generate)
- Number of particles per second (obvious!)
- Direction (a vector that serves as the principle axis of emission)
- Cone of emission in degrees (the particles will be emitted about direction vector randomly)
- Min size and max size (randomly generate particles of different sizes, unless if min==max in which case all particles are of the same size
- Life time in milliseconds (obvious!)
- Is half-life (DOES NOT WORK FOR NOW)
- Initial speed range (min and max values for initial speed)
- Gravitational acceleration
- Collision Detection
Example
1. Open the "Setup Dialog"
2. Set Point source of emission 0, 1, 0
3. Set Cone of emission in degrees to 90
4. Set gravitational acceleration to -0.000002
5. Optionally, turn on or off Collision detection
6. Press F4
To start or stop the simulation, press F4. You can start and
stop at any time, even when you open the Setup Dialog and make
changes.
Sometimes, it might be difficult to type in a number like
-0.000002 because values are updated dynamically. In this case,
type 0.000002 and then place the minus sign. Sorry about this.
Download
particlespray.zip (800 KB)
Files included are :
DialogGL.exe
16tile01.png
colorspot.png
lightmap.png
glhlib.dll
libjpeg.dll
libpng.dll
zlib.dll
devil.dll

Screenshot of particles falling on the floor and bouncing around.
THE END
|
|
|