I have been experimenting with particles to make fire. However I have something that could be loosely described as fire, but a long way from realistic.
I didn't write all this code, I borrowed it from a book, and started modifying it for my own needs.
Basically I have the fire the right size, and the right location, but I want it more realistic.
Also how to add random swirls and stuff, and less robotic looking.
If I was using particles in 3ds max I would think about making the particles smaller, and increasing the amount of particles to give a better effect, but I am not exactly sure what I am doing, using trial and error. heh heh mind you if was trying to create fire in 3ds max I would probably use fumefx, but that is another story.
Anyway here is the current code, and a picture to show the fire I have already.
So if anyone knows how to make a better fire, then let me know, and lend me your matches.
Code: Select all
IParticleSystemSceneNode* ps = smgr->addParticleSystemSceneNode(false);
IParticleEmitter* em = ps->createBoxEmitter(aabbox3d<f32>(55, 0, -5,5, 1, 80),
vector3df(0.0f, 0.1f, 0.0f),50, 200,SColor(0, 255, 0,0),
SColor(0, 255, 255, 255),650, 650, 0,dimension2df(20.f, 20.f),dimension2df(20.0f, 20.0f));
ps->setEmitter(em);
em->drop();
ps->setPosition(vector3df(-320, 30, -30));
ps->setScale(vector3df(1, .1, 1));
ps->setMaterialFlag(EMF_LIGHTING, false);
ps->setMaterialFlag(EMF_ZWRITE_ENABLE, false);
ps->setMaterialTexture(0, driver->getTexture("data/fire.bmp"));
ps->setMaterialType(EMT_TRANSPARENT_ADD_COLOR);