6.20.3 A Wriggling Snake
This example demonstrates how the age of the object can be used for
determining the time when the object should "die". As soon as the
object gets old enough, it disappears. The sample object is moved along
a B-Spline curve just like we did in our first CREATION example, but
now we will also delete target objects so that the earlier an object is
born, the earlier it dies.
1. Create the objects described in the example 6.19.3 but now add also
the SDEL tag to the sample sphere:
SDEL l=t-fx>0.1
The variable "fx" defines the time when the object was created. The
variable "t" represents the Current time. So, the age of the object is
t-fx and when the age gets greater than 0.1, the object is old enough
for the deletion.
Save and play the animation and in the beginning, it resembles our
first CREATION example. However, soon the oldest spheres start to die
and the number of spheres comprising the tube no longer rises.
|