GMU:Principia Textilica/Eeva Ahlamo: Difference between revisions

From Medien Wiki
No edit summary
m (Updating)
Line 52: Line 52:
The way I made the petals was with bezier vertex in Processing. I set the first point with vertex() and then let the programme randomise some of the other points like this:
The way I made the petals was with bezier vertex in Processing. I set the first point with vertex() and then let the programme randomise some of the other points like this:


bezierVertex(i-random1, i-50, i-random1, i-150, i, i-200);
  bezierVertex(i-random1, i-50, i-random1, i-150, i, i-200);
 
  bezierVertex(i+random1, i-150, i+random1, i-50, i, i);
bezierVertex(i+random1, i-150, i+random1, i-50, i, i);


Here the starting point for the form is i, i. The 1st and 2nd values are the coordinates for the bezier handle that starts from the starting point in vertex(). 3rd and 4th and the second bezier handle's coordinates (that are attached to the finishing point) and the 5th and 6th values are the x and y of the finishing point for the line. So these two lines are the two sides of a petal. For each flower in the programme I set different random values, because I didn't want any two flowers to be similar (the programme randomises the value only once, so random1 value is the same for each random1 used in the code.) With the rotate-command I rotated the petals so that it created 6 of them. Here still the whole code for one flower. The different random values I set in the beginning of the programme.
Here the starting point for the form is i, i. The 1st and 2nd values are the coordinates for the bezier handle that starts from the starting point in vertex(). 3rd and 4th and the second bezier handle's coordinates (that are attached to the finishing point) and the 5th and 6th values are the x and y of the finishing point for the line. So these two lines are the two sides of a petal. For each flower in the programme I set different random values, because I didn't want any two flowers to be similar (the programme randomises the value only once, so random1 value is the same for each random1 used in the code.) With the rotate-command I rotated the petals so that it created 6 of them. Following, the whole code for one flower. The different random values I set in the beginning of the programme. '''(The full code for the flowers I did is visible on my [https://github.com/west468/Principia-Textilica-Course/tree/master/16-final-project Github page].)'''


   pushMatrix(); '''// I tell the thing to keep this code in its own 'pocket''''
   pushMatrix(); '''// I tell the thing to keep this code in its own 'pocket''''
Line 72: Line 71:




'''The full code for the flowers I did is visible on my [https://github.com/west468/Principia-Textilica-Course/tree/master/16-final-project Github page].'''
----


After I had tested and tweaked the code to my liking I got out the flowers I had in mind. Here I had already set the colours to what I wanted:
After I had tested and tweaked the code to my liking I got out the flowers I had in mind. Here I had already set the colours to what I wanted: