Problems with point emitter

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Tom87@21
Posts: 6
Joined: Wed Nov 17, 2004 7:40 pm

Problems with point emitter

Post by Tom87@21 »

Hi all !

I'm working for the first time with a particle sstem in Irrlicht 0.11.
With this code, I have a little problem :? : the particle emitter moves like if it was on a line (the particles are emitted, with the good texture, colors..., the affectors works, but I would like that the emitter stand at it place)

I've also add a water plane and use the terrain generator => they work very well.

Code :

Code: Select all

// create a particle system
	IParticleSystemSceneNode *pParticleSys = 0;
	pParticleSys = pScenemgr->addParticleSystemSceneNode( false );
	pParticleSys->setPosition( vector3df(7.5,1,1) );
	pParticleSys->setScale( vector3df(1,1,1) );
	pParticleSys->setParticleSize( dimension2d<f32>(5.0f, 5.0f) );
	
	// create an emitter
	IParticleEmitter* pPEmit = pParticleSys->createPointEmitter(
		vector3df( 0.0f, 0.07f, 0.0f ), 
		100, 1000, 
		SColor( 0,255,180,0 ),
		SColor(0,255,255,0),
		20000, 40000, 90 );
	
	pParticleSys->setEmitter( pPEmit );
	// on peut le dropper maintenant
	pPEmit->drop();
	
	// prepare a fade out to destroy particles
	IParticleAffector* pPAffect = pParticleSys->createFadeOutParticleAffector();
	pParticleSys->addAffector( pPAffect );
	pPAffect->drop();
	
	// create a gravity affector
	pPAffect = pParticleSys->createGravityAffector();
	pParticleSys->addAffector( pPAffect );
	pPAffect->drop();

	// no lighting
	pParticleSys->setMaterialFlag( EMF_LIGHTING, false );
	// set particles' texture
	pParticleSys->setMaterialTexture( 0, pDriver->getTexture("halo.bmp") );
	// add alpha support for fade out
	pParticleSys->setMaterialType( EMT_TRANSPARENT_VERTEX_ALPHA );
Thanks for those who could help me :wink:
Time doesn't wait !
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

I have the same problem.Could anybody help please
Post Reply