Processing Animation

I used animation variables in Processing to make the following animation.

The Code Used:

float circleX = 0;
float circleY = 0;
float circleW = 50;
float circleH = 100;
float circleStroke = 0;
float circleFill = 255;
float backgroundColor = 255;
float change = 0.5;
float squareX = 640;
float squareY = 430;
float squareStroke = 0;
float squareRed =0;
float squareGreen = 255;
float squareBlue = 0;
float triX1 = 0;
float triX2 = 13;
float triX3 = 45;
float triY1 = 480;
float triY2 = 600;
float triY3 = 520;
float triStroke = 0;
float triFill = 255;
void setup() {
size(720,480);
smooth();
}
void draw() {
background(backgroundColor);
stroke(triStroke);
fill(triFill);
triangle(triX1,triY1,triX2,triY2,triX3,triY3);
triX1 = triX1 + change;
triX2 = triX2 + change;
triX3 = triX3 + change;
triY1 = triY1 – change * 2;
triY2 = triY2 – change * 3;
triY3 = triY3 -change * 5;
triStroke = triStroke + change;
triFill = triFill – change;
stroke(circleStroke);
fill(circleFill);
ellipse(circleX,circleY,circleW,circleH);
circleX = circleX + change;
circleY = circleY + change;
circleW = circleW + change;
circleH = circleH – change;
circleStroke = circleStroke + change;
circleFill = circleFill – change;
stroke(squareStroke);
fill(squareRed,squareGreen,squareBlue);
rect(squareX,squareY,180,180);
squareX = squareX – change;
squareY = squareY – change;
squareStroke = squareStroke + change;
squareRed = squareRed + change;
squareGreen = squareGreen – change;
squareBlue = squareBlue +change;
}

Advertisements

About degrafgo

I am a fun, green loving guy who owns 3 YouTube channels under the name DeGraphics.
This entry was posted in Time Based and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s