• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

Processing Language for visuals

Leitz

SOC-14 1K
Admin Award
Baron
O'Reilly sent out a note about a free class on Processing and Arduino. Well, they recommend a $75 hardware kit to fully get the benefit of Arduino, but it seems optional.

This got me started on Processing and so far it's rather fun. Given that I've got neither artistic talent nor coding greatness, I was able to make a simple sketch of a Type S in a few hours of tutorial reading and guesswork.

Here's the code that draws in on the screen and saves it in bofh PDF and JOG format:


Spoiler:

import processing.pdf.*;

void setup() {
size(250,400);
beginRecord(PDF, "type_s_scout.pdf");
background(255);
}

void draw() {
noFill();
triangle(125,50,200,300,50,300);

fill(150);
ellipseMode(CENTER);
ellipse(125,250,30,40);

fill(0);
rect(75,300,20,10);
rect(155,300,20,10);

rect(120,220,3,20);
rect(127,220,3,20);

triangle(125,105,135,150,115,150);

endRecord();
save("type_s_scout.jpg");

}


So far the biggest downer seems to be a lack of an active IRC channel. The Processing forum is hokey, but we'll see how it goes. I'm off to see what I can do to learn OOP and make this more malleable.

L
 
Back
Top