Here's a sneaky peek at my animations:
Clouds are surrounded by cotton wool.
Heavy rain is not very impressed by his amazingly colourful background.
code:
// final heavy rain animation
import processing.candy.*;
import processing.xml.*;
float angle;
SVG blob1;
SVG blob2;
SVG blob3;
SVG blob4;
SVG blob5;
SVG bigdrip;
void setup()
{
size(1500, 800);
frameRate(30);
smooth();
blob1 = new SVG(this, "blob_001.svg");
blob2 = new SVG(this, "blob_002.svg");
blob3 = new SVG(this, "blob_003.svg");
blob4 = new SVG(this, "blob_004.svg");
blob5 = new SVG(this, "blob_005.svg");
bigdrip = new SVG(this, "heavy_002.svg");
}
void draw()
{
background(206, 237, 255);
translate(500, 400); // center animation
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 50, 50, 80, 80); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 100, 100, 90, 90); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob3.draw( 150, 150, 100, 100); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob4.draw( 200, 200, 150, 150); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob2.draw( 250, 250, 200, 200); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 350, 350, 250, 250); // placement and size
}
popMatrix();
bigdrip.draw( -200, -200, 400, 400);
}
2.6.09
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment