Ouais un concours de demo, ça peu êtres intéressant, le problème c’est que moi, niveau créativité je suis une quiche… Je suis un codeur moi, monsieur B)
Après si tu as des idées Buss, je veux bien aider. Vu que ça fait un moment que je voulais me remettre à toucher du code.
Sinon un truc fait à la va vite ce matin…
[codebox]void setup() {
size(600,600);
background(0);
stroke(255);
branch(0,0,width);
}
void branch(float x, float y, float h) {
h *= 0.33f;
if (h > 2) {
//translate(x,y);
rect(x+h,y+h,h,h);
branch(x+0 ,y+0,h);
branch(x+h ,y+0,h);
branch(x+2h,y+0,h);
branch(x+0 ,y+h,h);
branch(x+0 ,y+2h,h);
branch(x+2h,y+2h,h);
branch(x+h ,y+2h,h);
branch(x+2h,y+h,h);
}
}[/codebox]
Pareil il n’y a pas de commentaires, mais ont sens fous c’est joli B)
Boupjof
PS : J’avais jamais réussi à implémenter cet algo avec les profs à l’IUT et la en 10 minutes c’est torché Processing FTW
Hop edition pour un autre petit code, encore une fractale je suis fan.
[codebox]
void setup() {
size(1000,1000);
background(0);
stroke(255);
translate(10,50);
// branch(width-20,600);
branch(1000-20,600);
}
void branch(float h, float theta) {
h *= 0.33f;
float rotation = radians(theta);
theta = theta * 2;
if (h > 0.9) {
pushMatrix();
line(h,0,0,0);
branch(h,-theta);
translate(h,0);
stroke(0);
line(h,0,0,0);
stroke(255);
rotate(rotation);
line(-h,0,0,0);
translate(-h,0);
branch(h,theta);
rotate(rotation);
line(-h,0,0,0);
translate(-h,0);
branch(h,theta);
rotate(rotation);
line(h,0,0,0);
branch(h,2*theta);
popMatrix();
}
}
[/codebox]