Sonntag, 8. April 2012

update:

- sound implementation
- particle system

Particle System:

at first you need to initialize the particle system on this way:

in the function webGLStart() -> LSD01.php:

var particleID = 0;
var particleCOUNT = 2500;
var emitterPOS = [0.0,-1.5,-50.0];
initPARTICLES( particleID  , particleCOUNT  ,emitterPOS);


in case you want more than just one system in your project:


initPARTICLES( 1, particleCOUNT  ,emitterPOS);
initPARTICLES( 2, particleCOUNT  ,emitterPOS);
initPARTICLES( 3, particleCOUNT  ,emitterPOS);
initPARTICLES( 4, particleCOUNT  ,emitterPOS);
initPARTICLES( 5, particleCOUNT  ,emitterPOS);
...


afterwards you need to update it. i would suggest if you going to do this in the loop function, either you could use the world function or any function which is related to the loop function.

var particleID = 0;
var is_selfCOLLIDING = 0;
updatePARTICLES( particleID  , is_selfCOLLIDING );

if you had init more than just one system. the similar point fits, you need to say which system id needs to be updated. like:

updatePARTICLES( 1, is_selfCOLLIDING );
updatePARTICLES( 2, is_selfCOLLIDING );
updatePARTICLES( 3, is_selfCOLLIDING );
updatePARTICLES( 4, is_selfCOLLIDING );
updatePARTICLES( 5is_selfCOLLIDING );
...

calling the SOUND:


in the function world():

var audio = loadSOUND('http://www.aries-lenov.com//projekte/webgl/dev/audio/bckgrnd.mp3');
soundPLAY(audio);


the variable audio stores the audio buffer which is created at loadSOUND. at soundPLAY you going to say which buffer should be executed.

as you know the engine is still highly in a experimental phase. so its not recommented for doing any projects with.

stay tuned...

greetz
dirk




Keine Kommentare:

Kommentar veröffentlichen