I've just begun using Irrlicht.NET CP, and I'm trying to create a particle system. I can make a basic scene, load meshes, use shaders, but I can't get a particle system up and running.
I treat particle system nodes like I do any other node, but for some reason their position seems accurate, but I can't get anything to show up. As a result, I've tried to child a billboard node underneath the particle system, but it won't display:
Code: Select all
// Create an empty node.
SceneNode empty = Program.Device.SceneManager.AddDummyTransformationSceneNode(Program.Device.SceneManager.RootSceneNode, 0);
empty.Position = new Vector3D(0, 0, 10);
// Adds a particle system.
ParticleSystemSceneNode ps = Program.Device.SceneManager.AddParticleSystemSceneNode(true, Program.Device.SceneManager.RootSceneNode, 0);
ps.ParticleSize = new Dimension2Df(32, 32);
ps.Position = new Vector3D(0, 0, 10);
ParticleEmitter emit = ps.CreatePointEmitter(new Vector3D(0, 0, -1), 50, 100, IrrlichtNETCP.Color.Red, IrrlichtNETCP.Color.Red, 400, 1100, 45);
ps.SetEmitter(emit);
ParticleAffector pspaf = ps.CreateFadeOutParticleAffector(IrrlichtNETCP.Color.Red, 5000);
ps.AddAffector(pspaf);
ps.SetMaterialFlag(MaterialFlag.Lighting, false);
ps.SetMaterialTexture(0, Program.Device.VideoDriver.GetTexture(textureFileName);
ps.SetMaterialType(MaterialType.TransparentVertexAlpha);
BillboardSceneNode bill = Program.Device.SceneManager.AddBillboardSceneNode(ps, new Dimension2Df(16, 16), 0);
bill.SetMaterialFlag(MaterialFlag.Lighting, false);
bill.SetMaterialType(MaterialType.TransparentAddColor);
bill.SetMaterialTexture(0, Program.Device.VideoDriver.GetTexture(textureFileName);
Does anyone know what the problem may be?