GMU:Einführung ins Programmieren mit Processing/Seminar: Difference between revisions

From Medien Wiki
m (syntaxhighlight verwenden!)
Line 507: Line 507:
     }
     }
   }
   }
<syntayhighlight />
</syntaxhighlight>


- Tristan Weis
- Tristan Weis
Line 516: Line 516:
Most part of spider consists of symmetrical patterns. The definition of size (width, height, P3D) can let the patterns move around the y-axis and present as the mirror effects. Looking closely to the spider, it can be divided into 4 parts, antenna, head, body, and leg, which are mostly made up by circles and lines.  
Most part of spider consists of symmetrical patterns. The definition of size (width, height, P3D) can let the patterns move around the y-axis and present as the mirror effects. Looking closely to the spider, it can be divided into 4 parts, antenna, head, body, and leg, which are mostly made up by circles and lines.  


1) The antenna is not a regular pattern,use the shape() to draw on of this and then move it around the Y-axis for (PI).
# The antenna is not a regular pattern,use the shape() to draw on of this and then move it around the Y-axis for (PI). <br/>'''Function''': ''beginShape();endShape();rotateY ();''
<br/>'''Function''': ''beginShape();endShape();rotateY ();''<br/><br/>
# The head of spider is very simple, only a ellipse. <br/>'''Function''': ''ellipse(), fill()''
2)The head of spider is very simple, only a ellipse.
# body can also be seen as collection of ellipse. Two big ellipse are surrounded by 6 small ellipses. <br/>'''Function''': ''ellipse ();fill();for(){};rotate();''
<br/>'''Function''': ''ellipse(), fill()''<br/><br/>
# The spider has 8 legs, 3 long and 5 short feet. Use for(){} to copy the lines and make it turns in the certain angle.
3) body can also be seen as collection of ellipse. Two big ellipse are surrounded by 6 small ellipses.
#'''Function''': '' for(){};line();strokeWeight();rotate();pushMatrix();popMateix();''
<br/>'''Function''': ''ellipse ();fill();for(){};rotate();''<br/><br/>
4) The spider has 8 legs, 3 long and 5 short feet. Use for(){} to copy the lines and make it turns in the certain angle.
<br/>'''Function''': '' for(){};line();strokeWeight();rotate ();pushMatrix();popMateix();''<br/><br/>
——Lu
——Lu


Line 531: Line 528:
==== Growing Ivy ====
==== Growing Ivy ====


[[File:tree_all_elements_changed.jpg|800px]]
[[File:tree all elements changed.jpg|800px]]


The pattern consists of one basic shape – the shape of the leaves. One leave has an organic figure which could be transformed into a geometric form. This geometric shape exists of three equilateral triangles: the first one is the biggest with the hypotenuse at the bottom. The other two triangles are smaller than the first one. They are half sized and arranged in a diagonal way. Two-thirds of those triangles are inside the bigger triangle. Their top shows one to the left and one to the right side.  
The pattern consists of one basic shape – the shape of the leaves. One leave has an organic figure which could be transformed into a geometric form. This geometric shape exists of three equilateral triangles: the first one is the biggest with the hypotenuse at the bottom. The other two triangles are smaller than the first one. They are half sized and arranged in a diagonal way. Two-thirds of those triangles are inside the bigger triangle. Their top shows one to the left and one to the right side.  
Line 539: Line 536:


===== First Sketch =====
===== First Sketch =====
[[File:green_pattern.jpg]]
[[File:green pattern.jpg]]
 
<syntaxhighlight lang="cpp">
int x = 0;
int x = 0;


Line 577: Line 574:
   }
   }
}
}
 
</syntaxhighlight>
===== Second Sketch =====
===== Second Sketch =====
[[File:black_pattern.jpg]]
[[File:black pattern.jpg]]
 
<syntaxhighlight lang="cpp">
int x = 0;
int x = 0;


Line 617: Line 614:
   }
   }
}
}
 
</syntaxhighlight>
===== Third Sketch =====
===== Third Sketch =====
[[File:layered_pattern.jpg]]
[[File:layered pattern.jpg]]
 
<syntaxhighlight lang="cpp">
int x = 0;
int x = 0;


Line 705: Line 702:
   popMatrix();
   popMatrix();
}
}
 
</syntaxhighlight>
=== Andreas Dietrich ===
=== Andreas Dietrich ===
Sketches for the practice homework:
Sketches for the practice homework:
===== First Sketch =====
===== First Sketch =====
[[File:Homework_AD_1.png]]
[[File:Homework AD 1.png]]
int dia=50;<br/>
<syntaxhighlight lang="cpp">
int innerDia=150;<br/>
int dia=50;
int steps=30;<br/>
int innerDia=150;
int steps2=30;<br/>
int steps=30;
int steps3=30;<br/>
int steps2=30;
int steps3=30;


int offset1=0;<br/>
int offset1=0;
int offset2=10;<br/>
int offset2=10;
int offset3=20;<br/>
int offset3=20;


size(900, 600);
size(900, 600);
Line 754: Line 752:
   }
   }
}
}
 
</syntaxhighlight>
===== Second Sketch =====
===== Second Sketch =====
[[File:Homework_AD_2.png]]
[[File:Homework AD 2.png]]
int dia=50;<br/>
<syntaxhighlight lang="cpp">
int innerDia=150;<br/>
int dia=50;
int steps=60;<br/>
int innerDia=150;
int steps=60;


float offset1=0;<br/>
float offset1=0;
float offset2=10;<br/>
float offset2=10;
float offset3=20;<br/>
float offset3=20;


float CONST_OFFSET1=0;<br/>
float CONST_OFFSET1=0;
float CONST_OFFSET2=10;<br/>
float CONST_OFFSET2=10;
float CONST_OFFSET3=20;<br/>
float CONST_OFFSET3=20;


float speed1=1;<br/>
float speed1=1;
float speed2=0.5;<br/>
float speed2=0.5;
float speed3=0.7;<br/>
float speed3=0.7;


void setup() {
void setup() {
Line 825: Line 824:
   }
   }
}
}
 
</syntaxhighlight>
===== Third Sketch =====
===== Third Sketch =====
[[File:Homework_AD_3.png]]
[[File:Homework AD 3.png]]
<syntaxhighlight lang="cpp">
int dia=50;
int innerDia=150;
int steps=30;


int dia=50;<br/>
float offset1=0;
int innerDia=150;<br/>
float offset2=10;
int steps=30;<br/>
float offset3=20;


float offset1=0;<br/>
float CONST_OFFSET1=0;
float offset2=10;<br/>
float CONST_OFFSET2=10;
float offset3=20;<br/>
float CONST_OFFSET3=20;


float CONST_OFFSET1=0;<br/>
float speed1=1;
float CONST_OFFSET2=10;<br/>
float speed2=0.5;
float CONST_OFFSET3=20;<br/>
float speed3=0.7;


float speed1=1;<br/>
float scaleVal=0.1;
float speed2=0.5;<br/>
float currentScale=1;
float speed3=0.7;<br/>
float toScaleVal=1;
 
float scaleVal=0.1;<br/>
float currentScale=1;<br/>
float toScaleVal=1;<br/>


void setup() {
void setup() {
Line 927: Line 926:
   }
   }
}
}
 
</syntaxhighlight>
= 13/11 =
= 13/11 =