turning human silhouette into birds [noob]
in
Programming Questions
•
2 years ago
Using the bird class from the examples in 3D > transform > birds,
would this be the correct way to do it?
currently experimenting with it and apparently no birds are coming out ...
would this be the correct way to do it?
currently experimenting with it and apparently no birds are coming out ...
- columns = a.width / cellsize; // Calculate # of columns
rows = a.height / cellsize; // Calculate # of rows
image(a, 75, 50,width/2,height/1.5);
for ( int i = 0; i < columns; i++) {
// Begin loop for rows
for ( int j = 0; j < rows; j++) {
int h = i*cellsize + cellsize/2; // x position
int v = j*cellsize + cellsize/2; // y position
int loc = h + v*a.width; // Pixel array location
float r = red(a.pixels[loc]); // Grab the color
float g = green(a.pixels[loc]);
float b = blue(a.pixels[loc]);
if ((r+g+b)= 0){
birdCount =k;
birds[k] = new Bird(h, v,
0, random(5, 30), random(5, 30));
x[k] = random(20, 340);
y[k] = random(30, 350);
z[k] = random(1000, 4800);
rx[k] = random(-160, 160);
ry[k] = random(-55, 55);
rz[k] = random(-20, 20);
spd[k] = random(.1, 3.75);
rot[k] = random(.025, .15);
birdCount++;
}
}
}
1