pretty dang cool fire(w/ source)

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

pretty dang cool fire(w/ source)

Post by qwe »

Here it is. the texture is "particle.bmp" that comes with the engine.

Code: Select all

camera = smgr->addCameraSceneNode(0, vector3df(0,10,-40), vector3df(0,0,0));


	IParticleSystemSceneNode* ps = 0;
	ps = smgr->addParticleSystemSceneNode(false);
	ps->setPosition(core::vector3df(0,0,-10));
	ps->setParticleSize(core::dimension2d<f32>(3.0f, 3.0f));

	scene::IParticleEmitter* em = ps->createPointEmitter(vector3df(0.0f,0.003f,0),
		500,600,
		SColor(0,20,20,20),SColor(0,70,70,70),
		900,1800,
		45);


	ps->setEmitter(em);
	em->drop();

	scene::IParticleAffector* paf = 
		ps->createFadeOutParticleAffector(SColor(0,0,0,0),500);

	ps->addAffector(paf);
	paf->drop();
	paf = ps->createGravityAffector(vector3df(0.0f,0.006f,0.0f),2000);
	ps->addAffector(paf);
	paf->drop();
	ps->setMaterialFlag(video::EMF_LIGHTING, false);
	ps->setMaterialTexture(0, driver->getTexture("particle.bmp"));
	ps->setMaterialType(EMT_TRANSPARENT_VERTEX_ALPHA);
wrap with your favorite createDevice() call and event loop. :wink:
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Can ya give us a screenshot?
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

Post by qwe »

Image

here ya go :)
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

:shock: wow, nice :D
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

Post by qwe »

thanks.

I don't know how fast it would be rendered with a whole scene though.
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

It's very helpful.Thanks Qwe :D
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

Post by qwe »

no prob. it looks even better in full motion 8)
Post Reply