# Generative Design Variations M.4.2.1 Attractor

The part of the Generative Design book where I have arrived now is about attractors. I quote (a part of) the book’s summary: ‘An attractor simulates attracting forces. As with magnets, the closer the objects (in this case the nodes) are to the attractor, the more strongly they are attracted to it. An attractor functions iteratively, meaning that with each calculation step, the velocity vectors of all the nodes within a defined radius around the attractor are modified so that they are moved toward it.’ And here you can find the original code:
M_4_2_01

I thought it would not be sensible to put my variations of the programs online because the programs are not supported by JavaScript. This is mainly because JavaScript does not support the Generative Design library. So I have prepared a Flickr Album which contains all still images I have made during this assignment. You can find those clicking this link:
GDV_M_4_2_1

You may also click the link after each paragraph. That link redirects you to the images I describe in each paragraph. So I started with changing the display size to 800 x 800. Decreased the xCount and yCount (the amount of nodes) from 200 to 50. Adjusted the grid size to 600 x 600. Inverted the background to black. Changed the impact of the attractor on the nodes to 100. And I would like to begin with a very weak force of the attractor on the nodes. So I decided to calculate the force by dividing it by multiplication of the radius with 150. That gives a very subtle difference which may be hard to see. But for me it has just enough impact to be noticed. Like that built-in reset nodes function. It’s like a very straight undo function.
M_4_2_01_GDV_01

Doubled the amount of node counts from 50 to 100. And I have no idea where those noisy patterns are coming from.
M_4_2_01_GDV_02

I Have set the node-damping to 0.01. Damping is used to slow down the nodes. In fact the setting I now use means that the damping is so low that the nodes (almost) never stop moving. They continue to move for a minute or 2, maybe 3. Some of them may bounce back from the boundaries of the display window. I also increased the radius of the attractor (the mouse button) to 200 pixels.
M_4_2_01_GDV_03

I Increased the grid to 700 x 700 pixels. Set the node damping to 0.001. Also increased the xCount and yCount amount of nodes to 200. Lowered the alpha level of the fill wich draws the real nodes.
M_4_2_01_GDV_04

Reduced the xCount and yCount again and I increased the size of the nodes to 4 by 4 pixels.
M_4_2_01_GDV_05

I have picked up the original settings of the program from the Generative Design book code. Resetting the program to it’s original numbers gives me too chaotic images. So I reduced xCount and yCount to 40 nodes. The gridsize is now 700 x 700 pixels. And I have defined a function key for adding some red color. I also decreased the effects by reducing float f = 1 / pow (s, 0.001) -1. This gives a very small movement to the nodes.
M_4_2_01_GDV_06

Used red, magenta, blue, cyan, green and yellow to render a more colourful image. I increased the power by which the base is raised from 0.001 to 0.005. Increased the size of the node from 1 x 1 to 2 x 2 pixels.
M_4_2_01_GDV_07

Because I did not really know what was going on I reduced the amount of nodes to 10 x 10. But that did not give me the results wich could give me an answer. So I continued to work with the previous settings. Just for fun I tried what black could do to the image. Not a good one. It made the image quit rough. All the refinement was lost. Tried white. That did not work either. It bleached the image out. Increased the attractor radius from 200 to 300. And that worked better.
M_4_2_01_GDV_08

It seems that when you decrease the effects by reducing float f = 1 / pow (s, 0.001) -1 that gives the best results. But what happens if I make it a negative number. Well… not much. I put it back to a positive number.
M_4_2_01_GDV_09

I increased the xCount and yCount to 200. Damping is still on 0.001. The nodes are 1 x 1 pixel. The influence radius is on 300. And f = 1 / pow (s, 0.005) -1. But why I get those TV-like images. I really do not know. And I also don’t mind for now.
M_4_2_01_GDV_10