noobish rotation questions
in
Programming Questions
•
1 year ago
hi,
1.i made this by trial and error but what is the best formula to create symetric circles (no gaps, no overlaps) from shapes using rotation?
2.how to add second rotation inside draw which would make this whole wheel to rotate?
this should be incredibly easy i guess but somehow i can't make it right now
float r=0;
void setup(){
size(768,576);
background(0);
smooth();
noFill();
}
void draw(){
translate(width*0.5,height*0.5);
while(r<20){
rotate(PI/20);
stroke(random(255),random(255),random(255));
rect(250,0,20,30);
r+=0.2;
}
}
1.i made this by trial and error but what is the best formula to create symetric circles (no gaps, no overlaps) from shapes using rotation?
2.how to add second rotation inside draw which would make this whole wheel to rotate?
this should be incredibly easy i guess but somehow i can't make it right now
float r=0;
void setup(){
size(768,576);
background(0);
smooth();
noFill();
}
void draw(){
translate(width*0.5,height*0.5);
while(r<20){
rotate(PI/20);
stroke(random(255),random(255),random(255));
rect(250,0,20,30);
r+=0.2;
}
}
1