FOR LOOP EXPERIMENTS — 012.
By adding an opacity element to the fill of a shape, I can also create a gradient effect as each ellipse stacks on top of each other, the density of the gradient increasing with each innermost ellipse.
seen from China
seen from India
seen from China

seen from United States
seen from Germany
seen from Germany

seen from United States
seen from Israel
seen from United States
seen from Yemen

seen from Saudi Arabia
seen from Belgium
seen from United Kingdom

seen from United States
seen from United States

seen from United States
seen from China
seen from Germany
seen from China
seen from China
FOR LOOP EXPERIMENTS — 012.
By adding an opacity element to the fill of a shape, I can also create a gradient effect as each ellipse stacks on top of each other, the density of the gradient increasing with each innermost ellipse.
FOR LOOP EXPERIMENTS — 011.
‘For loops’ are also able to control the size of a shape, i.e. an ellipse. By placing the line of code inside the ‘for loop’ and using the ‘i’ variable to represent the shape of the ellipse, I am able to gradually increase the size of each generated ellipse, as well as controlling its coordinates.
FOR LOOP EXPERIMENTS — 005/006/007/010.
Continuing the ‘for loop’ experimentation, I moved from lines to ellipses. This was extremely similar to the experiments that used lines, except that the direction of the ellipses was now also explicitly controlled by the ‘for loop’. I could control the y-axis of each generated ellipse so that there is a line of ellipses going downwards, or control the x-axis alongside so the line of ellipses is diagonal.
FOR LOOP EXPERIMENTS — 001/002/003/004/009.
In class, we were introduced to ‘for loops’ in Processing. ‘For loops’ function in a format of for([initial;test;update]), where you set the initial value, what the ‘for loop’ tests, and what it updates the output to.
This was tested with the basic knowledge we learnt in the last unit with line stroke, weight, and colour. I used a for loop to create the succession of multiple lines instead of typing out a line of code for each line. This also ensured that the spaces between the lines were consistent, as it might not be if I were to input the coordinates for the individual lines.
‘For loops’ can also control the RGB element — the colour of the lines. This meant I could gradually change the colour with each generated line, creating a ‘gradient’ effect.
NOTE: The gradient in the example was an evenly distributed share of blue on the left and pink on the right, but Tim said that there was a mathematical bit in the code I would have to figure out to get the exact 50/50 output. I didn’t bother with the exactness.