Emitting Ribbon like patterns with particles ?


#1


Hi folks,
I am trying to work on some emission pattern but in ribbon form. for rendering reason the output has to be in particles only so cant really use any emitting softbody trick.
on top of my head I could think of using some surface or poly patch ( instanced gemoetry later converted to geo ) & emit from them as trail…but when it comes to lot of particles then dealing with lot of uninstancer geo can be over kill. so any insight or some smarter way to do this will be really helpful here. Thanks very much !

something like this : http://www.youtube.com/watch?v=twg3qN3Ho4Q

https://vimeo.com/37743091

Best,

  • Vik

#2

Hey Hi Vik,

would it be wise to use n hairs and to emit particles from them so that we can have such wavy motions.


#3

not sure about the nHair approach & But I got it working with the help of Duncan :wink:
here is the particle approach suggested by him :

I created a rot and rotVel vector attribute on a particle system, then initialized with random speeds in a creation expression:
$s = .1; // rotation speed
nParticleShape1.rotVel = <<rand($s),rand($s),rand($s)>>;
nParticleShape1.rot = <<0,0,0>>;

Then in a runtime expression I update the rotation by adding the velocity to it
nParticleShape1.rot = nParticleShape1.rot + nParticleShape1.rotVel;

Then I use the rotation to emit a line of particles into a second particle system. To create an unbroken ribbon (when the emitting particles are moving fast) I needed to also emit additional rows of particles based on the velocity:
nParticleShape1.rot = nParticleShape1.rot + nParticleShape1.rotVel;
vector $r =nParticleShape1.rot;
float $rx = $r.x;
float $ry = $r.y;
float $width = .2;
float $fps = 24.0;
float $p2Rad = nParticleShape2.radius;

vector $dir = <<sin($rx),cos($rx),0>>; // currently this only uses the x+y rotate values
float $dy = cos($ry) - sin($ry) * $dir.y;
float $dz = sin($ry) + cos($ry) * $dir.y;
$dir = <<$dir.x, $dy, $dz>>;

int $i,$j;
vector $p = nParticleShape1.position;
vector $streak = nParticleShape1.velocity/$fps;
float $sLen = mag( $streak );

int $count = int($width/$p2Rad + 0.6) + 1;
int $sCount = int($sLen/$p2Rad + 0.6);
for( $i = 0; $i<=$count; $i++ ){
float $u = (float)$i/(float)$count -0.5;
$u *= $width;
vector $pos = $p + $dir * $u;
for($j = 0; $j < $sCount; $j++ ){
float $v = (float)$j/(float)$sCount;
vector $pos2 = $pos - $streak * $v;
emit -pos ($pos2.x) ($pos2.y) ($pos2.z) -o nParticleShape2;
}
}

To avoid any order of evaluation problems the second particle system is assigned to a different solver.

Duncan


#4

Interesting post-thanks for sharing. Would this be able to replicate the first image you posted. It seems more complicated than an emitter partical moving helically. The in-between parts of the helix are connected.
As a thought have you tried using oversampling to keep the trails smooth on the fast moving emitters?


#5

Yes Pretty much by adding a ramp multiplier to $width in runtime ! I asked the same question to Duncan. he replied " You could make the very bottom of the ramp the same as the top, although this could also affect the newly created particles. In general it won’t if it a small enough region at the bottom of the ramp. I think the age normalized is not strictly between 0 to 1 because of the start emission time being randomized within a frame.

Instead you could simply avoid emitting by adding this to the runtime expression:

if(ageNormalized < 1 ){
(the rest of the expression goes here)
}

to control the density of the trail particles by simply multiplying the value of p2Rad (the radius from the second particle system)in the expression. The count is setup so that one gets a slight overlap for a given radius. If you wanted to control the density of particles separately along the width vs velocity, you could edit the lines that set count and sCount. "

Yes I did over sample it & you might have to change the $fps value accordingly to simulate it correctly. hope this helps !


#6

Super interesting viki, thanks for the reply. Will take a proper look when i have time. Cheers!


#7

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.