Wednesday, 5 March 2014

Thinking Particles: "Conveyor Belt" setup: Advanced

This expands on the basic conveyor belt system by adding some more functionality:



This setup adds a few things to the basic version. The particles fly onto the conveyor belt. They align to the conveyor and keep an alignment throughout the path. They also "fall off" at the end of the path. This was part of a wider dynamic used to simulate ribosome translation as seen on this wikipedia .gif:


In this I will only go over the added content. The rest is explained in the "Thinking Particles: "Conveyor Belt" setup: Basic" post

Scene setup:

This time I have a curved path to work with. There is the spawn point for the trigger particles again, and a teapot to use as a shape instance, but that is it.



Method:

Two helper particles are created. One is a Start Point and the other an End Point along the path. The start point has an alignment to the path, and serves as a position and alignment for a BringTo, so the trigger particles can find their way onto the path. The End Point is there so when particles get close to it (and so to the end of the path) they can be put into another group, detaching them from the path.

Groups:

Spawn_Start_Point:
Spawn_End_Point:
Path_Particles:
     Spawn_Trigger_Particles:
     Spawn_Path:
Path_End:

Dynamics:

Spawn_Start_Point:
     Creates one particle in the Spawn_Start_Point group and adds a PathFollow. As this particle has no speed and the path is not moving, it does not matter this is assigned at birth and not to the particle group. It has "alignment" checked, and in this case I had to switch the "path" axis to "x" (This same alignment needs to be applied to all the other PathFollow nodes created). This creates a particle at the beginning of the path with an alignment following the path.



Spawn_End_Point:
     Creates one particle in the Spawn_End_Point group and adds a PathFollow. This time the "start" is changed to be a very high value. This ensures the particle will be spawned at the end of the path. The alignment is not important on this particle and so is not assigned.



This is what the two particles look like in the scene:




Spawn_Pre_Path:
     Same as before.




Spawn_Trigger_Particles:
     Same as before.


Assign_Shapes:
     As before this is used for visualization.


Send_To_Trigger:
     The Spawn_Trigger_Particles are brought to the Spawn_Start_Point particle using a BringTo. It also aligns the particle, allowing a smooth transition to when the Spawn_Trigger_Particle has a PathFollow applied to it. There is a Distance and Threshold condition to send the particle to another group when it gets close enough to it's target particle.


Path_Velocity:
     Same as before.



Path_Push_Along_Others:
     Same as before.


Path_Follow:
     The only change here is the alignment on the PathFollow has to be the same as the alignment used in the Spawn_Start_Point PathFollow.


Send_to_Path_End:
    Sends the particles within the Path_Particles group hierarchy to the Path_End group when they get within a certain distance to the Spawn_End_Point.



Path_End:
     Adds a simple force to the Path_End group to mimic a gravity. This makes them "fall off" the conveyor belt at the end.