TUTORIAL 14:   This tutorial explains how To integrate many Eye candy effects such as exposion,fire,snow,lazer ray,smoke tray , thanks to NemoX Particle Engine class Interface
             
 

 

----TUTORIAL 14---

Adding great particle Effects

 

You will Need The NemoX engine Get it Here

download the Visual Basic Source code here

 

Summary

 

1. Particle Effects objects declaration

2. Particle ojects initialization code

3. Rendering the particle Effects

 

 

1. Particle Effects objects declaration

Particle object declaration follows all visual basic default object declaration like:

Dim myObject as AnyObjectInterface

'Then we allocate memory for that object

set myObject=new AnyObjectInterface



So our object declaration for Particle effect will follow that:

'=============== OBJECT DECLARATION=============='

'SHOCK WAVE EFFECT 1 OBJECT
Dim SHOCK1 As cNemo_ParticleEngine 

'SHOCK WAVE EFFECT 2 OBJECT
Dim SHOCK2 As cNemo_ParticleEngine

'CUSTUM EFFECT OBJECT
Dim FX_2 As cNemo_ParticleEngine

'FIRE PARTICLE SYSTEM OBJECT
Dim FIRE As cNemo_ParticleEngine

'for SNOW PARTICLE SYSTEM EFFECT
Dim SNOW As cNemo_ParticleEngine

 

'=============== OBJECT MEMORY ALLOCATION=============='

    Set SHOCK2 = New cNemo_ParticleEngine
    Set FX_2 = New cNemo_ParticleEngine

    Set FIRE = New cNemo_ParticleEngine

    Set SNOW = New cNemo_ParticleEngine

    Set SHOCK1 = New cNemo_ParticleEngine

 

 

2. Particle ojects initialization code

'Prepare our particle system here

    
'we Prepare our SHOCKWAVE 1 effect here we pass as parameters:
 'the emitter position =Vector(0, 15, 10)
 'the texture FileName =App.Path + "\particle.BMP"
 'Number of particle to use =80
 'Effect type =NEMO_EXPLOSION_SHOCKWAVE_FX 'for Built-in SHOCKWAVE
    SHOCK1.InitParticles Vector(0, 15, 10), App.Path + "\particle.BMP", 80, NEMO_EXPLOSION_SHOCKWAVE_FX
    SHOCK1.Set_ShockWave SHOCHWAVE_X
    SHOCK1.Set_ParticleSize 50, 50
    SHOCK1.Set_ParticleLifeTime 5000
      'we Prepare our SHOCKWAVE 2 effect here :

    SHOCK2.InitParticles Vector(0, 15, 10), App.Path + "\particle.BMP", 100, NEMO_EXPLOSION_SHOCKWAVE_FX
    SHOCK2.Set_ParticleSize 50, 50
    SHOCK2.Set_ParticleLifeTime 5000
    SHOCK2.Set_ShockWave SHOCHWAVE_Z
      'we Prepare our FOUNTAIN  effect here :

    FX_2.InitParticles Vector(0, 15, 10), App.Path + "\particle.BMP", 100, NEMO_FONTAIN_FX
    FX_2.Set_ParticleLifeTime 5000
    FX_2.Set_ParticleSize 50, 50
      'we Prepare our SNOW effect here :

    SNOW.InitParticles Vector(0, 15, 0), App.Path + "\snow.bmp", 200, NEMO_SNOW_FX
    SNOW.Set_Snow 800, 800, 800, 1
    SNOW.Set_ParticleSize 10, 10

      'we Prepare our FIRE effect here :


    FIRE.InitParticles Vector(0, 15, 10), App.Path + "\FIRE.bmp", 80, NEMO_FIRE_FX
    'customize fire Blending effect here from NEMO_FIRE_FX1 to NEMO_FIRE_FX21
    FIRE.Set_Fire 60, , 0.5, NEMO_FIRE_FX4
    FIRE.Set_ParticleSize 10, 10
    FIRE.Set_ParticleDrawingMode True

 

3. Rendering the particle Effects

 

'to render our particle system objects we use MyParticleOBject.Render
'render Particles

        SHOCK2.Render

        'animate this one
        FX_2.Set_EmiterPosition 50 + Sin(Timer * 2) * 150, 45, Cos(Timer * 2) * 150
        FX_2.Render

        SNOW.Render

        FIRE.Render

        SHOCK1.Render

 

 

Very incredible effects can be archieved with NemoX particle Engine object when DEFAULT particle behavior style is chosen.

 

Here is a screenshot for our tutorial project

download the Visual Basic Source code here

See you in the next Tutorial.....sincerly Polaris..Don't forget Any Bugs detect

The Next: Tutorial 15 :Using Free 6DOF camera

                                     The Previous: Tutorial 13 :Loading Quake 3 Models

 

Tutorial Written on August, 4 th 2003 by Polaris: johna_pop@yahoo.fr