Particles and particle systems
Particles and particle systems
Maybe this is how it has been coded, but...
when i rotate a particle system, all the particles rotate with it (they even stop facing the camera)
when i move a particle system, all its particles move with it
when i remove a particle systen all particles are deleted
isn't there a default way to make the particles independant from their system?
when i rotate a particle system, all the particles rotate with it (they even stop facing the camera)
when i move a particle system, all its particles move with it
when i remove a particle systen all particles are deleted
isn't there a default way to make the particles independant from their system?
-
- Posts: 35
- Joined: Wed Mar 24, 2004 2:34 pm
- Location: Germany
- Contact:
I have the problem with rotateting and the camera, too.
I hope someone can help.
I hope someone can help.
Look at http://www.z-software.de for interesting games.
-
- Posts: 35
- Joined: Wed Mar 24, 2004 2:34 pm
- Location: Germany
- Contact:
I mean if I make Particle to the modell as child and then rotate the modell, than the particles rotate, too, and then you can see the problem. If the angle becomes 180 degree then the particles disapear. And before you see, that the particles are only 2D bitmaps. So I think this problem was meant by facing.
Or do you mean different thing? (Sorry I am not so good in english)
Or do you mean different thing? (Sorry I am not so good in english)
Look at http://www.z-software.de for interesting games.
Well, yes, in all the examples , particles look fine from all the angles, but i don't think there is an example where the ISceneNode::setRotation funcion is used in a IParticleSystemSceneNode object, which is exactly the problem.
Everything works just fine until I start aplying transformations to the particle system node.
Everything works just fine until I start aplying transformations to the particle system node.
-
- Posts: 35
- Joined: Wed Mar 24, 2004 2:34 pm
- Location: Germany
- Contact:
I have an idea. It isn't good idea, but i haven't better one.
But we can create our own Particle Emitter. And then we create own particles. But we don't make them 3D. We put three 2D particles in different angles. always in angles of 90 degree. Then we put BackCulling off(But only for Particles). And then it doeas't matter how often you rotate them.
But there is a disadvantage: It is not so fast. It is very slow because of following things:
1) we have to draw for one particle 6 Triangles and not 2. (three times slower I think)
2) if we put off backcullig the graphic card has to draw the particles two times. (one time front and one time back)
So it is twelve times slower, if I calculate right. If not, please say it.
And you can't use it often. But for one or two effects it will be ok I think.
If someone has an better idea, say please.
EDIT: Sorry for my bad english.
But we can create our own Particle Emitter. And then we create own particles. But we don't make them 3D. We put three 2D particles in different angles. always in angles of 90 degree. Then we put BackCulling off(But only for Particles). And then it doeas't matter how often you rotate them.
But there is a disadvantage: It is not so fast. It is very slow because of following things:
1) we have to draw for one particle 6 Triangles and not 2. (three times slower I think)
2) if we put off backcullig the graphic card has to draw the particles two times. (one time front and one time back)
So it is twelve times slower, if I calculate right. If not, please say it.
And you can't use it often. But for one or two effects it will be ok I think.
If someone has an better idea, say please.
EDIT: Sorry for my bad english.
Look at http://www.z-software.de for interesting games.
Before doing that i would implement my own Particle Emitter node. It would be faster
Also, with that solution, the particles would still be linked to the particle system scene node, so they would move with it, and many effects (fire from the propeller of an airshif, a particle track left by a light sphere) wouldn't work
a pity
Also, with that solution, the particles would still be linked to the particle system scene node, so they would move with it, and many effects (fire from the propeller of an airshif, a particle track left by a light sphere) wouldn't work
a pity
-
- Posts: 35
- Joined: Wed Mar 24, 2004 2:34 pm
- Location: Germany
- Contact:
Oh Sorry I mean own particle node. Not Emitter.yin nadie wrote:Before doing that i would implement my own Particle Emitter node. It would be faster
Also, with that solution, the particles would still be linked to the particle system scene node, so they would move with it, and many effects (fire from the propeller of an airshif, a particle track left by a light sphere) wouldn't work
a pity
Look at http://www.z-software.de for interesting games.
This fixes the moving particles problem. Works with point emitters, haven't tried it with box emitters. YMMV
First, in SParticle.h, add a core::vector3df called startPos.
After line 270 of CParticleSystemSceneNode.cpp add:
Replace line 296 with:
Basically what this does is offset the particle position by the distance between the point where the particle was emitted and the point at which the particle system scene node is currently at. make sense?
Please note that doing this requires you to recompile the engine, which requires the DirectX 9 SDK.
First, in SParticle.h, add a core::vector3df called startPos.
After line 270 of CParticleSystemSceneNode.cpp add:
Code: Select all
array[i].startPos = getAbsolutePosition();
Replace line 296 with:
Code: Select all
Particles[i].pos +=
((Particles[i].startPos - getAbsolutePosition())/2 - (Particles[i].startPos - lastPos)/2) + (Particles[i].vector * scale);
Please note that doing this requires you to recompile the engine, which requires the DirectX 9 SDK.
-
- Posts: 35
- Joined: Wed Mar 24, 2004 2:34 pm
- Location: Germany
- Contact:
Thanks for help.
But for recompiling you needn't DX SDK, but without DX SDK you must comment out these lines:
they are in IrrCompileConfig.h
lines 26 and 27
EDIT: Someone should mail Nico to fix this bug.
Have someone done it?
EDIT: If you compile the engine without DX SDK then you have no DX Support.
EDIT: Compiling without DX is not good. I have problems to make run new DLL. (I use DevC++, but I edit Irrlicht with VC++6)
But for recompiling you needn't DX SDK, but without DX SDK you must comment out these lines:
Code: Select all
//#define _IRR_COMPILE_WITH_DIRECTX_8_
//#define _IRR_COMPILE_WITH_DIRECTX_9_
lines 26 and 27
EDIT: Someone should mail Nico to fix this bug.
Have someone done it?
EDIT: If you compile the engine without DX SDK then you have no DX Support.
EDIT: Compiling without DX is not good. I have problems to make run new DLL. (I use DevC++, but I edit Irrlicht with VC++6)
Look at http://www.z-software.de for interesting games.
-
- Posts: 35
- Joined: Wed Mar 24, 2004 2:34 pm
- Location: Germany
- Contact:
Thanks.
But I have fast internet. I will download it now .
But I have fast internet. I will download it now .
Look at http://www.z-software.de for interesting games.