int points= 35000;
void setup() {
size(500, 500);
colorMode(HSB);
background(0);
}
void draw() {
if (frameCount < points) {
stroke(map(frameCount, 0, points -1, 0, 255), 255, 255);
ellipse(random(width), random(height), 1, 1);
} else if (frameCount == points) {
saveFrame("Random.png");
} else {
loadPixels();
for (int i = 0; i < pixels.length - width; i++) {
if (pixels[i + width] == color(0)) {
pixels[i + width] = pixels[i];
pixels[i] = color(0);
}
}
updatePixels();
}
}
void mouseClicked() {
saveFrame("Distribuição.png");
}
int points= 35000;
void setup() {
size(500, 500);
colorMode(HSB);
background(0);
}
void draw() {
if (frameCount < points) {
stroke(map(frameCount, 0, points -1, 0, 255), 255, 255);
float r = random(min(width, height)/2);
float a = random(TAU);
ellipse(width/2 + cos(a) * r, height/2 + sin(a) * r, 1, 1);
} else if (frameCount == points) {
saveFrame("Random.png");
} else {
loadPixels();
for (int i = 0; i < pixels.length - width; i++) {
if (pixels[i + width] == color(0)) {
pixels[i + width] = pixels[i];
pixels[i] = color(0);
}
}
updatePixels();
}
}
void mouseClicked() {
saveFrame("Distribuição.png");
}
int points= 35000;
void setup() {
size(500, 500);
colorMode(HSB);
background(0);
}
void draw() {
if (frameCount < points) {
stroke(map(frameCount, 0, points -1, 0, 255), 255, 255);
boolean test = false;
float x = 0;
float y = 0;
while (!test) {
x = random(width);
y = random(height);
test = (dist(x, y, width/2, height/2) < min(width, height)/2);
}
ellipse(x, y, 1, 1);
} else if (frameCount == points) {
saveFrame("Random.png");
} else {
loadPixels();
for (int i = 0; i < pixels.length - width; i++) {
if (pixels[i + width] == color(0)) {
pixels[i + width] = pixels[i];
pixels[i] = color(0);
}
}
updatePixels();
}
}
void mouseClicked() {
saveFrame("Distribuição.png");
}
float dist(int x1, int y1, int x2, int y2) {
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
Nenhum comentário:
Postar um comentário
Pode falar, eu não mordo... Pelo menos não através da internet