Re: [osg-users] Particles problem

2013-07-31 Thread Flavien Du Peloux
Hi,

I am 4 years late but maybe it will help someone else.
I had a problem wich was similar to yours: i wanted to hide/show a node who had 
a particleSystemUpdater attached, and the accumulation problem came to me there.

So that's what i did to get around:
We should not hide/show the node (or ParticleSystemUpdater) attached to the 
ParticleSystem, but the Emitter. In my case, it was a ModularEmitter but it's 
the same.
And then you have 2 solutions, both work:

Code:

//hide or show the modular emitter
emitter-setNodeMask(0 or 1);





Code:

//set the counter of the emitter to 0. It's a little trick but it works.
//if you do this, remember that you have to have to set back the real counter 
of the emitter when you want to show again your particles
counter = new osgParticle::RandomRateCounter;
counter-setRateRange( osgParticle::rangef(0,0) );
emitter-setCounter(counter);




This solution might not be the best, but that's the only one i found for now.

Cheers,
Flavien

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=55149#55149





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Particles problem

2009-11-16 Thread Robert Osfield
HI Max,

The particle system is set between several nodes, so which ones are
you attempting to hide/unhide and how?

Robert.

On Mon, Nov 16, 2009 at 8:22 AM, Maxim Gammer maxgam...@gmail.com wrote:
 Hello all,

 I came across the following situation.
 Let us have an object with particles child and that object is hidden.
 When we unhide this object we get picture 2 and 3.
 Why particles don't dissapiar when the parent object is hidden? Why do they
 accumulate? And how to deal with it, how to fix?

 P.S. Picture 1 shows how it shoud be.
 --
 Maxim Gammer


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Particles problem

2009-11-16 Thread Maxim Gammer
Hi Robert,

I've tried 3 different ways.
1 - Both particles and emitter are children of the hidden/unhidden object
2 - Particles is the child of object, and emitter is in the root.
3 - Emitter is a child of the object and particles is in the root.

Hiding/unhiding is done by SetNodeMask. (FF or 00)...

Max

2009/11/16 Robert Osfield robert.osfi...@gmail.com

 HI Max,

 The particle system is set between several nodes, so which ones are
 you attempting to hide/unhide and how?

 Robert.

 On Mon, Nov 16, 2009 at 8:22 AM, Maxim Gammer maxgam...@gmail.com wrote:
  Hello all,
 
  I came across the following situation.
  Let us have an object with particles child and that object is hidden.
  When we unhide this object we get picture 2 and 3.
  Why particles don't dissapiar when the parent object is hidden? Why do
 they
  accumulate? And how to deal with it, how to fix?
 
  P.S. Picture 1 shows how it shoud be.
  --
  Maxim Gammer
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Maxim Gammer
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Particles problem

2009-11-16 Thread Maxim Gammer
What do you mean by switching off?
And can it be done automatically when the object's parents get hidden?



2009/11/16 Robert Osfield robert.osfi...@gmail.com

 Hi Maxim,

 Have you tried switching off the ParticleSystem node?  It's the
 ParticleSystem that does the rendering, the rest of the nodes just
 control how the particles are generated and moved.

 Robert.

 On Mon, Nov 16, 2009 at 10:52 AM, Maxim Gammer maxgam...@gmail.com
 wrote:
  Hi Robert,
 
  I've tried 3 different ways.
  1 - Both particles and emitter are children of the hidden/unhidden object
  2 - Particles is the child of object, and emitter is in the root.
  3 - Emitter is a child of the object and particles is in the root.
 
  Hiding/unhiding is done by SetNodeMask. (FF or 00)...
 
  Max
 
  2009/11/16 Robert Osfield robert.osfi...@gmail.com
 
  HI Max,
 
  The particle system is set between several nodes, so which ones are
  you attempting to hide/unhide and how?
 
  Robert.
 
  On Mon, Nov 16, 2009 at 8:22 AM, Maxim Gammer maxgam...@gmail.com
 wrote:
   Hello all,
  
   I came across the following situation.
   Let us have an object with particles child and that object is hidden.
   When we unhide this object we get picture 2 and 3.
   Why particles don't dissapiar when the parent object is hidden? Why do
   they
   accumulate? And how to deal with it, how to fix?
  
   P.S. Picture 1 shows how it shoud be.
   --
   Maxim Gammer
  
  
   ___
   osg-users mailing list
   osg-users@lists.openscenegraph.org
  
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
  
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 
  --
  Maxim Gammer
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Maxim Gammer
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Particles problem

2009-11-16 Thread Robert Osfield
On Mon, Nov 16, 2009 at 11:09 AM, Maxim Gammer maxgam...@gmail.com wrote:
 What do you mean by switching off?
 And can it be done automatically when the object's parents get hidden?

I would have though that would work, or just setting the NodeMask of
the ParticleSystem.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Particles problem

2009-11-16 Thread Maxim Gammer
Should we get back to that problem later?
Could you tell me, where to look for a solution? Wht to begin with?

Thanx for help.

2009/11/16 Robert Osfield robert.osfi...@gmail.com

 On Mon, Nov 16, 2009 at 11:09 AM, Maxim Gammer maxgam...@gmail.com
 wrote:
  What do you mean by switching off?
  And can it be done automatically when the object's parents get hidden?

 I would have though that would work, or just setting the NodeMask of
 the ParticleSystem.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Maxim Gammer
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Particles problem

2009-11-16 Thread Robert Osfield
Hi Maxim,

On Mon, Nov 16, 2009 at 12:05 PM, Maxim Gammer maxgam...@gmail.com wrote:
 Should we get back to that problem later?
 Could you tell me, where to look for a solution? Wht to begin with?

I'm just guessing, I haven't actual tried what you after.  I'm not the
original author of osgParticle either so please just except my
suggestions as to what should be possible, rather than anything
definitive.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org