Thursday, 27 February 2014

Thinking Particles: "Conveyor belt" setup: Basic

This is a setup for creating a conveyor belt like effect in Thinking Particles. In the video, as a teapot enters the box point it triggers an event, and a particle is spawned at the beginning of a path and then all the particles on the path are pushed along. Additionally, there are particles that are spawned along the path so you don't need to pre-roll particles.



Basic scene setup:

A teapot to use as a shape instance, a path to act as the conveyor belt, a point to spawn trigger particles, and a point they can move into to activate a slide of the conveyor belt.



Method:

When an event is triggered, a particle is spawned and has a Path Follow applied to it. It is then given a burst of speed when it is born that lasts for a few frames. This pushes it along the path. Once this time is up, the particle is given a very tiny speed as to maintain its direction.

Groups:

Spawn_Trigger_Particles:
Spawn_Path:

Dynamics:

Spawn_Trigger_Particles:
     Spawns particles at the cross point. Particles are put into the Spawn_Trigger_Particles group.



Spawn_Pre_Path:
     Spawns particles only at the first frame, so that there are particles already spread out on the path. Particles are put into the Spawn_Path group.



Assign_Shape:
     Something nice to look at.



Send_To_Trigger:
     Bring To that attracts the Spawn_Trigger_Particles to the box point. Once they are close enough to the point, a particle is created in the Spawn_Path group.



Path_Velocity:
     This controls the speed of the particles along the path. This has to be before the path follow or the particles will not stick to the path. The idea is to have the particle that is created move for a short time then stop. I used a particle age to create an on/off boolean that I use to determine speed. Whilst the particle is within the particle age, there is a speed of 1, when it falls out of the range the speed hits 0, and the particle stops. By adding a multiplier I can increase the speed the particle gets.

However, in order to maintain the direction of the particles, the speed cannot get to 0, as the vector is lost. To maintain the direction along the path therefore, I add a tiny amount of speed after the on/off velocity to keep that vector. The speed is so slow you will not notice any movement, but stops the particles getting "stuck" when the speed hits zero.



Path_Push_Along_Others:
     This PPass finds the particle next to them and inherits their speed. This means when a particle is created and starts moving, it will push the others along. The Expression works out the speed of the particle from the particle velocity using Pythagoras' Theorem, which is then put through a Threshold to determine if it is above the tiny amount of speed set earlier (effectively the "no speed"). This means only particles with speed are allowed to transfer their speed, otherwise the particle that is created will inherit the "no speed" of the particle in front of it and it will not move.

The expression:
sqrt(a^2 + b^2 + c^2)




Path_Follow:
     Constrains the particles to a path. The Path_Follow has the Initial Speed set as defined. I also set Multiple Particles to Defined at a Distance of 10, as the radius of my teapot was 5 (diameter 10). This ensure the particles are evenly spaced along the line.


No comments:

Post a Comment