hello there,
with this little sketch (inspired by "generative gestaltung")
i figured out for myself how to handle
a rotation in 3D and to work with random.
(order vs. disorder)
i did this to learn processing and to get used to the programing-language.
two other projects/lessons will follow soon.
put the code in your editor and push the play button.
i think, it's self explaining...
cheers
ingo
Code:
int actRandomSeed = 0;
int count = 19;
void setup() {
size(600, 600, P3D);
cursor(CROSS);
background(255);
smooth();
stroke(255);
}
void draw() {
background(0);
noFill();
stroke(255);
strokeWeight(0.5);
translate(width / 2, height / 2);
float faderX = (float)mouseX/width;
float faderY = (float)mouseY/height;
rotateX (lerp(0, PI, faderY));
randomSeed(actRandomSeed);
for (int i=0; i<count; i++){
float structureX = 0;
float structureY = PI/count;
float structureZ = 0;
float chaosX = random(degrees(0.01));
float chaosY = random(degrees(0.01));
float chaosZ = random(degrees(0.01));
rotateX (lerp(structureX, chaosX, faderX));
rotateY (lerp(structureY, chaosY, faderX));
rotateZ (lerp(structureZ, chaosZ, faderX));
ellipse(0, 0, 400, 400);
}
}
void mouseReleased() {
actRandomSeed = (int) random(10);
}