Categories
Uncategorized

Processing: Overlapping Ovals

Overlapping Ovals

I was unaware it was Processing Month, but I like the idea… so I’m going to try to kick out some sketches this month.

I’ll start off slow and (hopefully) see some improvement by the end of the month. This sketch is called “Overlapping Ovals” and you should be able to see it in action here if you’ve got a canvas-capable browser. (We’re using Processing.js to do the magic. I’m not sure that’s the best way to do this, but we’ll find out.)

/*
 * 20110503.pde
 */

void setup() { 
  size(800, 600); 
  background(0);
} 

int c = 1;

void draw() { 

  noFill();
  
  float rCol = random(50,240);
  float gCol = random(50,240);
  float bCol = random(50,240);
  stroke(rCol,gCol,bCol,50);
  strokeWeight(10);  
  
  float wNum = random(20,1200);
  float hNum = random(20,1200);
  ellipse((800/2), (600/2), wNum, hNum);

  if (c > 1000) {
   background(0);
   c = 1;
  }
  
  c++;
  
}

It basically draws 1000 randomly sized and colored ellipse on the screen, then clears the canvas, and does it again.

Again, I’m still a bit of a Processing newbie, so be kind, and hope that things get better as we go along. If you see something that seems all wrong, call it out so I can learn and improve it.

Categories
Uncategorized

Processing

Processing

I’ve become quite the fan of Processing. When I first started to dig into the Arduino world, I turned to my old friend Perl to deal with Arduino<->Computer communication, but quickly discovered that Processing was an ideal environment for such a thing.

Perl is great (you know, IMHO and all that) but the main appeal for me has always been in Perl’s data processing capabilities, and having CPAN and a module for almost everything. Perl is fun, but it’s not FUN. I’ve dabbled with generating graphics with Perl using GD and SVG modules, but it’s not anywhere near the area known as fun.

Processing, in my mind, is built for fun. So what is Processing?

Processing is an open source programming language and environment for people who want to create images, animations, and interactions. Initially developed to serve as a software sketchbook and to teach fundamentals of computer programming within a visual context, Processing also has evolved into a tool for generating finished professional work. Today, there are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning, prototyping, and production.

Processing sometimes gets called a “multimedia programming language” and is used quite a bit by artists and designers, and probably much less by hardcore software developers. Check out OpenProcessing for some great example sketches.

Drawing

My own sketches are not very impressive yet, but as I said, Processing it a lot of fun. It’s reminiscent of the olden days of graphics on the Apple ][ where you plotted things out in HIRES graphics mode but, you know, way more advanced.

It’s pretty easy to build Processing sketches that respond to sensors connected to a microcontroller like an Arduino (see Accelerometer Art) and that’s something I’ll definitely be exploring more of in the future.

Android

Processing runs on top of Java, or is a subset of Java, or whatever. This is great because you can easily create a Processing sketch that can run on Mac OS X, Windows, and Linux, and even create a standalone application for each platform. (It’s that promise of Java we had long ago!) But the real excitement is that the latest version of Processing lets you target Android as a platform. Supposedly you can build an app in Processing and get it into the Android Marketplace. (I’m not aiming to get anything into an ‘App Store’ but just want to run my own apps on my own devices, as mentioned in my Android vs. iPhone post.)

And speaking of the iPhone, it looks like iProcessing and Processing.js may be able to get Processing sketches running on iOS… neat! (Processing.js is also on my TO DO list. I’ve toyed with it briefly and it’s pretty amazing.)

One of my complaints about this “new world of Apps” on phones and tablets and non-traditional devices is that there is too much of a barrier to entry to building things that run on them. I’m hoping Processing might help bring that barrier down a bit.

Update: It seems May is Processing Month. I didn’t know! Now I feel compelled to do more.