nParticle Fill Object Jitter Problem


#1

Hi everyone.

    I do have to fill glas-object, lets say like a small aquarium with small cylinders.
    Because of the large amount of objects I have to pour in my object I am using nParticles and I instance the cylinders.
    
    My Problem is that the lower nParticles at the bottom of the aquarium keep on jittering and rotating, although there is no visible or logical dynamic force upon them.
    
    Duncan posted a similar scene here:
    [http://forums.cgsociety.org/showthread.php?t=1095641](http://forums.cgsociety.org/showthread.php?t=1095641)
    which perfectly shows my problem. Cache the scene and hide the cube and you will notice all the little tori jitter like hell.
    
    What I tried so far:
    I tried adjusting all dynamic attributes I could think of, friction, bounciness, damping whatever, with no satisfying results.
    
    Next step I dived into scripting:
    I added two attributes per Particle: 
    nParticleShape1.positionLastFrame (vector) and 
    nParticleShape1.rotateLastFrame (vector).
    
    By setting these attributes in the expression before dynamics to the value of current position and rotation, I am able to refer to these values to the position and rotation AFTER dynamics:
    
    Before Dynamics:
nParticleShape1.positionLastFrame = nParticleShape1.position;
       nParticleShape1.rotateLastFrame = nParticleShape1.rotationPP;
        
   After Dynamics I simply summed x,y and z velocity and checked if this sum is larger than a specific value I played around with.
   If the velocity is rather small, I set the position and the rotation of the particles after Dynamics to the values before dynamics :

expression after dynamics

vector $currentVelocity = nParticleShape1.velocity;  
      float $SummeVelocity = $currentVelocity.x + $currentVelocity.y + $currentVelocity.z;
       
     //make sure I get a positive value. There should be better ways, I was too lazy to find them.
         if ($SummeVelocity < 0) 
        	{
        		$SummeVelocity = $SummeVelocity *(-1);
        	}
       
          
       
        if ($SummeVelocity < .2)
        	{
        		nParticleShape1.rotationPP = nParticleShape1.rotateLastFrame;
        		nParticleShape1.position = nParticleShape1.positionLastFrame;
        	}
       
       
This works, well, OK. I could go with it (good enough design ...), but here are my questions:
Has anyone solved this problem, maybe in a more elegant way ?
Did I miss something? I mean, obviously particles that do not move somehow get velocity. Can I stop this?
Can I make the upper nParticles absorb the dynamics, so the lower ones just stay calm, neat and quiet ?
Does anyone understand my questions ?

I attached my current scene, if someone wants to have a look.


Have a lovely weekend !

#2

I have always considered this kind of problem to be related to trap checking on your particle object. Basically there is interpenetration and the trap check is trying to solve for this with a slight outward push.

could be that if you played with these settings you could get a better result or try upping the subsampling in your nucleus node.

just guesses but ive run into this plenty of times before.
good luck


#3

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.