Tuesday, February 16, 2016
Tuesday, February 9, 2016
Custom Function issues
I tried to do the assignment but I ran into a couple of issues:
void setup() {
size(2000, 1900);
smooth();
}
void draw() {
background(0);
randomSeed(0);
for (int i = 65; i < width + 20; i += 40) {
int gray = int(random(0, 102));
float scalar = random(0.25, 1.0);
snowman(i, 110, gray, scalar);
}
}
void snowman (int x, int y, int z, float s){
translate(x,y);
noStroke();
ellipse(250,350,300,200);
ellipse(250,250,250,150);
ellipse(250,150,150,150);
stroke(67,13,3);
strokeWeight(5);
fill(67,13,3);
line(150,220,50,220);
line(50,220,30,200);
line(50,220,30,220);
line(50,220,30,240);
line(350,220,450,220);
line(450,220,470,200);
line(450,220,470,220);
line(450,220,470,240);
ellipse(275,130,10,15);
ellipse(225,130,10,15);
ellipse(250,210,10,10);
ellipse(250,235,10,10);
ellipse(250,260,10,10);
fill(255);
arc(180, 150, 200, 60, 0, PI/3);
strokeWeight(1);
fill(255,94,0);
triangle(250, 160, 250, 150, 200, 170);
}
void setup() {
size(2000, 1900);
smooth();
}
void draw() {
background(0);
randomSeed(0);
for (int i = 65; i < width + 20; i += 40) {
int gray = int(random(0, 102));
float scalar = random(0.25, 1.0);
snowman(i, 110, gray, scalar);
}
}
void snowman (int x, int y, int z, float s){
translate(x,y);
noStroke();
ellipse(250,350,300,200);
ellipse(250,250,250,150);
ellipse(250,150,150,150);
stroke(67,13,3);
strokeWeight(5);
fill(67,13,3);
line(150,220,50,220);
line(50,220,30,200);
line(50,220,30,220);
line(50,220,30,240);
line(350,220,450,220);
line(450,220,470,200);
line(450,220,470,220);
line(450,220,470,240);
ellipse(275,130,10,15);
ellipse(225,130,10,15);
ellipse(250,210,10,10);
ellipse(250,235,10,10);
ellipse(250,260,10,10);
fill(255);
arc(180, 150, 200, 60, 0, PI/3);
strokeWeight(1);
fill(255,94,0);
triangle(250, 160, 250, 150, 200, 170);
}
The main issue is that I can't make it into different sizes, might be something wrong with my for loop.
Monday, February 1, 2016
int shapeSize = 10;
void setup()
{
size(500, 500);
}
void draw()
{
background(255, 255, 0);
//enable mouse setup
x = mouseX;
y = mouseY;
//color circles
fill(255, 230, 20);
//create circles
ellipse(x, y, sha
peSize, shapeSize);
ellipse(x - shapeSize, y, shapeSize, shapeSize);
ellipse(x + shapeSize, y, shapeSize, shapeSize);
}
void setup()
{
size(500, 500);
}
void draw()
{
background(255, 255, 0);
//enable mouse setup
x = mouseX;
y = mouseY;
//color circles
fill(255, 230, 20);
//create circles
ellipse(x, y, sha
peSize, shapeSize);
ellipse(x - shapeSize, y, shapeSize, shapeSize);
ellipse(x + shapeSize, y, shapeSize, shapeSize);
}
Subscribe to:
Posts (Atom)