![]() |
![]() |
||
![]() |
Attraction! |
||
![]() |
|||
![]() |
|||
![]() |
|||
Introduction |
|||
Attraction! is a freeware particle system simulation that attempts to be entertaining. This is why we call it a
Gimmick. |
|||
![]() |
|||
![]() |
|||
![]() |
|||
Quick Start |
|||
Start Attraction! by double-clicking its icon. Ignore all windows except the Attraction! - display window for now and start clicking and moving the mouse around in the window. You should see particles pop up and integrate into the system. The number of particles is being limited in order to stay realtime. Note: the window is rezisable, dont make it too big, though. Explore the other two windows on your own or read the sections The Controller Window and The Template Generation Window. |
|||
![]() |
|||
![]() |
|||
![]() |
|||
The Template Generation Window |
|||
A particles speed will be multiplied by its friction value each step. This means a value of 0 makes the
particle unmovable (not entirely, as I encoutered. if it should move, it's a certain sign that floating point
precision is exceeded). The particles mass will be used by other particles to determine how strong the influence is.
The other effect of mass is that the particle becomes more hard to move, because the velocity vector is
multiplied by it before being added to the speed vector. Determines the displayed size of a particle. You shouldn't use more than 25. Smaller sizes greatly reduce the time it takes to draw
them. A size 2 particle should draw about 25 times faster than a size 10 particle (overhead not considered).
You can use sizes like 2.3 or 3.8. A 3.1-particle will look (probaly inconcievably) bigger than a 3.0-particle. You can guess that. Special value is color 0,0,0 (black, upper left in the color selector). It will use the colorcycle mode from version 1.0. position and speedDetermines the position and speed the particle will initially have. The display region is (0.0,0.0)-(1.0,1.0). You will usually check the mouse check-box for position. Checking moused-speed and not moused pos will create the particle at the given position and use the relative mouse-position as initial speed-vector. Using the mouse for both position and speed will result in the following creation behaviour: Clicking the mouse will determine the position of the new particle. Hold the button down and move the mouse to a different position to set the speed vector and create the particle. relation to othersEach particle relates to all others the following way. It tries to keep the desired distance plus the partners desired distance. If the
distance of the two is not the desired distance, a force will be applied to change that state. The forces that result out of all the
relations are added up and later applied to the speed vector. Use the Attraction strength field as a general force multiplier to limit
or enhance the effect. |
|||
![]() |
|||
![]() |
|||
![]() |
|||
The Controller Window |
|||
The tape is a buffer to record the calculated frames (as position/size/color data) in.
You can see the tape's length in the line above the blue status bar. As frames are calculated,
they are added to the tape at the end and the size will be increased.
To save your system from crashing when the swap space is full, you should limit the tape size
to some reasonable value (maximum tape size control). These values are given in seconds. The framerate bar shows the current framerate (averaged over the last 16 samples taken). It will change it's color according to wether it meets the desired rate or not. again, to enter the desired rate, you'll have to focus the controller window by clicking its title or borde rendering modeI'll start with the blind mans mode: it chooses a rectangle around the particles position and just fills it with the appropriate color. In the other two modes the rectangle is taken as the render-area. for each pixel the distance to the position is calculated, squared and used as alpha-value. this allows sub-pixel positioning (like the beos font-routines). In 32 bit, the particle could theoretically be perceived to move 1/256th pixel. 32 bit would be nice, but up to this point I saw no need, because my aged 66mhz bebox would fail to push all that data through the double buffer' model controlthe respect bounds checkbox determines wether or not the particles bounce off the windows frame. This is for developers that want to now how long what takes. Shows how many particles are in the system and how long it takes to calculate, record to tape, draw to bitmap and blit to the screen one frame. the sum*rate value is all these timings added up and multiplied by the framerate. a value of 2.0 means that both processors are optimally used. If you should encounter this value, there's something wrong :) All these values are averaged over the last 16 samples.' NoteThe controller window will accept first clicks. If you want to enter values, you have to first activate the window by clicking its title-bar or its border. Sorry for that inconvenience, but I like being able to click the reset and rewind buttons without loosing focus on the template window. |
|||
![]() |
|||
![]() |
|||
![]() |
|||
The Physics |
|||
Keep in mind that it`s a stepped simulation, so actually cant be associated with the word Physics.
Each particle has a position and a speed attribute. That should be self-explanatory so far. Both are 2 dimensinal vectors
(double precision floating point). At each step each particles speed vector is added to its position vector. We have a
moving particle. Further I introduced a particle attribute called velocity (dunno about the term, I`m a german guy) used to
sum up the forces that influence the particle. We apply the velocity to the speed the same way we applied the speed to
position for each particle at each step. We have a particle that isn`t isolated, but influencable. |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
Updates: http://f3c.com/software/attraction/ |
||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
Author: Nick Fischer |
||
![]() |
|||
![]() |
|||
![]() |
|||
Attraction! is copyright © 1998, f3c - Nicolas and Daniel Fischer. All rights reserved. |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() ![]() |
f3c development |
![]() |