Life as Clay

Circle Circle Dot Dot Dot

with 2 comments


I promised myself that, when feasible, I would do something with Processing every day and post the results to this blog. Tonight was a little busy, so my post for today consists of three images that I generated based on code in the book that I’m reading. I shifted a few of the variables to create the variations. :)

Book CodeBook code variationDot matrixHere’s the code for the last one:

float r;
float g;
float b;
float a;

float diam;
float x=0;
float y=0;

void setup() {
  size(400,400);
  background(0);
  smooth();
}

void draw() {
  r = random(255);
  g = random(255);
  b = random(255);
  a = random(255);
  diam = 8;

  noStroke();
  fill(r,g,b,a);
  ellipse(x,y,diam,diam);

  if (x>400) {
    x = 0;
  } else {
    x = x + 10;
  }

  if (x>400) {
    y = y + 10;
  }

}
Advertisements

Written by Clay

October 29, 2009 at 01:07

2 Responses

Subscribe to comments with RSS.

  1. wow, who knew writing code could be so cool. well, maybe some people knew but i didn’t. really beautiful work!

    erika

    October 29, 2009 at 13:54

  2. Thanks Erika! I hope to make some more beautifuler stuff soon. :)

    Clay

    October 29, 2009 at 14:37


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

%d bloggers like this: