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.14.1 Gravity

The RADIAL FORCE method generates a force field which affects the target objects, so that the direction of the force field is defined by the line between the "center point" of the method and the particle. If the radial force field is positive, it pulls all targets towards it. If it is negative, it pushes targets away from it. This makes this method very suitable for simulating effects like electrical forces, magnetism and gravity.

So, let's create a particle system which uses the RADIAL. FORCE method for generating a gravity field. Our example consists of some particles, a RADIAL FORCE method and a PROCESSOR method.

1. Create one circle, activate macro recording, duplicate the circle, move the circle a bit, end macro recording and repeat the current macro 10 times. The circles are the particles.

2. Create a RADIAL FORCE method at the same level with the circles.

3. The RADIAL FORCE method requires one parameter, which is the position of the force "source". Use Create/Controls/Offset to create the parameter under the method.

4. Create a PROCESSOR method to the same level with the force method.

realtut6.14.1_1.png (2767 bytes)
YouTube Figure T6-44: A simple particle system. The gravity field pulls particles towards it.

Play the animation and all particles start to fall down towards the gravity point.

First, what is a "particle system"?

Traditional particle systems consist of a large number of particles (usually just points represented by their velocity, color etc.) acting under the influence of external force fields, such as gravity or wind. However , the particle system of REAL 3D is not what could be described as "a traditional particle system". The biggest differences are that force fields in REAL 3D are properties of objects themselves, and any object can be used as a particle. One could almost say that there is no particle system at all in REAL 3D. There are just objects which interact with each other and the animation is the result of such interaction process. But that is the situation in the Real world, too!

Because the particle system is implemented using methods, it is fully integrated to the animation system. This allows you to mix particle system oriented methods with all other methods. For example, if you have a walking robot, you can move it forwards using a force method.

Because of historical reasons, we use the term "particle" in the following examples instead of "target object". Anyway, a particle is just a target object of a particle oriented method.

So, how then do the "particle oriented" methods of REAL 3D work?

Particle oriented methods, such as RADIAL FORCE, generate a force field. This force field affects the "velocity" attribute of the object. The longer the force field affects the object, the more the velocity of the target is changed. This all happens according to Newton's laws of motion. If you recognize the formula

                   F=m*a

this all should be very clear to you. The term "F" in the formula describes, how strong the force field affecting the particle is. The term "m" is the mass of the particle and the term "a" is the resuming acceleration. In other words, if the force "F" affects the particle whose mass is "m", the acceleration for that particle will be "a".

What exactly is "acceleration"? Acceleration describes how much the velocity of the particle changes ("dv") during one second and can be solved from the following formula:

                        dv
                   a = ----
                        dt

By combining these two formulas, we can solve how much the velocity of a particle is changed during the time "dt".

                                  F * dt
                   F*dt=m*dv=>dv= ------
                                    m

So, if the strength of the force field generated by a force method is 1000 N, if the mass of the particle is 100 kg and if the time between subsequent frame is 0.1 s, the velocity of the object is changed

                       1000 kgm/s*0.1s
                   dv= --------------- =1.0m/s
                           100 kg

So, the purpose of the RADIAL FORCE method is just to change the velocity of target objects in very natural manner. By default, the method generates a force field which behaves like gravity. The formula used for that is:

                        m1*m2
                   F=g* -----
                          s

where m1 is the mass of the particle, m2 is the mass of the gravity point and "s" is the distance between them. "g" is the so called gravity factor whose value is 1.0. However, you can define the strength of the force field by associating custom formulas with the method object, as we will see later.

Attributes, such as mass, acceleration and velocity itself, do not move objects. To change the attributes to real motions, the PROCESSOR method is needed. This method reads all relevant attributes of target objects and moves (and rotates) the targets accordingly.

So, in order to create a particle animation, we need some particles, perhaps one particle system oriented method which modifies velocities and other properties of particles, simulating the Newtons laws of motion, and finally we need a PROCESSOR method which transforms the attributes of target objects to real motions.

If you have read all text above, you recognize the term "dt" and know that it means the time in seconds. So, how many seconds is the entire animation?

Open the animation window. The Seconds field describes the length of the animation in seconds. If the Resolution (number of frames) is 40 and Seconds is 1.0, this means that the "dt" between two subsequent frames is 1.0s / 40 = 0.025s.

Lets demonstrate the purpose of the Seconds field with an example.

ghh don'tpanic