realtlacitka.png (1143 bytes) Real3D Amiga Environment Real3D Amiga Tutorials Real3D Amiga Projects Real3D Amiga Macros Real3D Amiga Other Back to Real3D Amiga home page

6.19.2 Customized Friction

The FRICTION method can be customized, just like any other method, by adding a custom formula or procedure defining the strength of the friction force to it. This way it is easy to create some nice effects, like friction whose strength depends on the position (non-homogenous friction fields).

So, let's create simple particle animation where radial force moves a number of particles while one customized friction method resists their motions.

1. Create a set of spheres.

2. Create a RADIAL FORCE method. Create an offset primitive, defining the center of the force field, under the method.

3. Create a FRICTION method and add the following tag to it:

                   SFOR if(x<0,f=f*2,f=0)

The variable "x" reflects the current position of the particle in question. So, the formula uses a conditional expression where f is either duplicated or set to zero, depending on the position of the particle.

4. Create a PROCESSOR method and play the animation.

All particles on the left side (where the x coordinate values are less than zero) are affected by the friction, but particles on the right are not.

realtut6.19.2_1.png (3762 bytes)
YouTube Figure T6-56: A Non-homogeneous Friction Field.
ghh don'tpanic