Changing position of snowing
Posted: Tue Jan 31, 2006 6:22 pm
Hi all
I've a problem with changing position of snowing. I want that every while (device->run) cycle snowing position will change (in simple words just move snowing cube to another position with every redrawing of scene). Snowing position should be the same as camera position (it should make snowing effect). If someone can help me figure out how to do it, I will be happy...
Here is code of snowing effect:
Nice code,
Isgalvotas.
I've a problem with changing position of snowing. I want that every while (device->run) cycle snowing position will change (in simple words just move snowing cube to another position with every redrawing of scene). Snowing position should be the same as camera position (it should make snowing effect). If someone can help me figure out how to do it, I will be happy...
Here is code of snowing effect:
Code: Select all
ps = smgr->addParticleSystemSceneNode(false);
//ps->setPosition(core::vector3df(3800.0f,510.0f,7400.0f)); // -160,170,80
ps->setPosition(core::vector3df(snw_x,snw_y,snw_z));
ps->setScale(core::vector3df(2,2,2));
ps->setParticleSize(core::dimension2d<f32>(5.0f, 5.0f));
em = ps->createBoxEmitter(
core::aabbox3d<f32>(-270,-200,-270,270,300,300),
core::vector3df(0.01f,-0.02f,0.0f),
400,800,
video::SColor(0,255,255,255), video::SColor(0,255,255,255),
1800,3000);
ps->setEmitter(em);
em->drop();
paf = ps->createGravityAffector(core::vector3df(-0.05f,-0.03f, 0.0f), 2000);
ps->addAffector(paf);
paf->drop();
ps->setMaterialFlag(video::EMF_LIGHTING, false);
ps->setMaterialTexture(0, driver->getTexture("./data/snowparticle.bmp"));
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
Isgalvotas.