703
edits
No edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Zufällige Kompositionen == | == Zufällige Kompositionen == | ||
<source lang="Java">Segmente[] objekt = new Segmente[6]; | <source lang="Java" highlight="117">Segmente[] objekt = new Segmente[6]; | ||
void setup() { | void setup() { | ||
Line 126: | Line 126: | ||
objekt[i].h = (int)random(360); | objekt[i].h = (int)random(360); | ||
objekt[i].a = (int)random(50,100); | |||
} | } | ||
} | } | ||
Line 134: | Line 134: | ||
== Segmente == | == Segmente == | ||
<source lang="Java">class Segmente { | <source lang="Java" highlight="6,25">class Segmente { | ||
float x; // X-Position | float x; // X-Position | ||
float y; // Y-Position | float y; // Y-Position | ||
int seg; // Segmentzähler | |||
int r; // Radius | int r; // Radius | ||
float g; // Richtung | float g; // Richtung | ||
Line 157: | Line 157: | ||
} | } | ||
void maleSegmente( | void maleSegmente(int seg,int r,float g,float x,float y) { | ||
float segmentzahl = 3 + seg; | float segmentzahl = 3 + (float)seg; | ||
float angleStep = 360/segmentzahl; | float angleStep = 360/segmentzahl; | ||
edits