Hi Frank,

Take a look to the osgparticleeffects example in the examples folder. In
this code you can see how if you pick a moving model the particle system
moves with it. You can see the result picking the cessna or the hanglide
model in the example.

Hope this helps.

2010/7/15 Frank Sullivan <[email protected]>

> Hello,
>
> I am hoping to create a particle effect that moves. However, I am having
> difficulty with this. If I call ParticleEffect::setPosition, it seems to
> have the effect of destroying the existing particle system and rebuilding it
> from scratch:
>
>
> Code:
>
> void ParticleEffect::setPosition(const osg::Vec3& position)
> {
>    if (_position==position) return;
>
>    _position = position;
>
>    if (_automaticSetup) setUpEmitterAndProgram();
> }
>
>
>
>
> The result of this seems to be that only 1 particle is emitted before the
> Effect is reset, causing perhaps 2-3 particles to be emitted per second
> rather than the 200 or so that I set as the rate.
>
> So, I tried to instead add this ParticleEffect as a child of a
> MatrixTransform and, instead of moving the ParticleEffect with setPosition,
> I move the MatrixTransform instead. This has an interesting effect. The
> emitter itself seems to stay in the same exact spot. However, the particles
> have a definite inertia to them. I tried moving the MatrixTransform in a
> continuous circle on the x/y plane. The emitter didn't move, but the
> particles seemed to fly outward from this position, as if they knew they
> should be flying out at the circle's tangent, but weren't actually being
> emitted from changing positions on the circle's perimeter.
>
> Lastly, I tried setting the useLocalParticleSystem value to false, not
> knowing what it was, but thinking it was worth a try. The result seems to be
> that no particles are emitted (or perhaps they are emitted somewhere where I
> can't see them).
>
> Does anyone have any idea how I can achieve this, hopefully without
> modifying OSG code?
>
> Thank you!
>
> Cheers,
> Frank
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=30045#30045
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to