Boids Demo

Nikolaus Gradwohl2009-03-15T15:00:00+00:00

I just wrote a boids-demo in processing.

the boids obey the 3 rules defined by Craig Reynolds.

click here to see some boids flying around


read more ...

how to detect presentmode in processing

Nikolaus Gradwohl2009-03-15T10:21:00+00:00

in processing sketches can be run in "present" mode. which means a frame is generated in fullscreen mode and the code of the sketch is centered on the screen.

to change the size of the actual sketch depending on wether presend mode is active or not
the following code can be used

void setup() {
    for ( int i = 0; i < args.length; i ++ ) {
      if ("--present".equals(args[i])) {
        present = true;
    if (present) {
      size(screen.width,screen.height, OPENGL);
    } else {
      size(600,600, OPENGL);

    // do your normal setup stuff here
read more ...

3d Particle effect demo

Nikolaus Gradwohl2009-03-15T10:15:00+00:00

i used the makeTexture method from my firefly sketch to make a 3d particle demo

click here to download the sourcecode.


read more ...

Digital Fireflies

Nikolaus Gradwohl2009-03-14T21:14:00+00:00

I made another processing sketch that showes something glowing

click here to see some fireflies whirrl


read more ...

Rotating Stereo Cubes

Nikolaus Gradwohl2009-03-14T09:18:00+00:00

I made my first 3d processing sketch that generates a stereo image for cross eyed viewing

click here to see the cubes rotate

rotating cube

read more ...

window resizing in processing

Nikolaus Gradwohl2009-03-08T19:50:00+00:00

The following processing code shows how to resize a processing window from your code. the resizeApp methdo calculates the difference between the frame size and the size of the actual drawing area and adds it to the new size. then the application-frame is resized.

void setup() {

int col = 0;

void draw() {
  line(0,0,width, height);

void mousePressed() {
  if (col == 0) {
    resizeApp( 640, 400 );
    col = 255;
  } else {
    resizeApp( 320, 200 );
    col = 0;

void keyPressed() {

void resizeApp( int w, int h ) {
  int delta = frame.getHeight()-height;
   resize( w, h );
   frame.setSize( w, h + delta );
read more ...

processing ical-flowers-2.0

Nikolaus Gradwohl2009-02-15T08:15:00+00:00

I made a new version of the ical flowers sketch i wrote in dezember. This time it doesn't only show a flower for every event in my calender, it also shows

  • the current weather (using the rubyweather library)
  • the current temperature outside
  • the min/max temperature outside
  • the current temperature inside ( using my arduino i2c thermometer sketch)
  • the sky color changes depending on the current time

ical-flowers screen1

ical-flowers screen2

the system consists of a ruby-proxy, an arduino sketch and a processing sketch.

the ruby proxy starts a web-server on port 2000. It fetches the current weather using the rubyweather gem, fetches the events from the configured caldav calenders, and fetches the current temperature from the arduino using ruby-serial

the arduino sketch is basicaly the same as in this blog post. the only change is that the arduino only sends the temperature when the host sends a 'C' over the serial line

the processing sketch finally fetches the data via http from the proxy and displays it ( using my icap4p library. the screen is updated every 1/2 hour using the method described here

the code can be downloaded here

it's published under the LGPL

have fun :-)

read more ...

abstract art generator

Nikolaus Gradwohl2009-02-06T18:29:00+00:00

my latest processing-sketch is a generator for abstract art.

just click on the applet to generate a new image

abstract art generator

read more ...

Processing links

Nikolaus Gradwohl2009-02-05T18:02:00+00:00 the mother of all processing sites :-) a language and a microcontroller board that that go very well with processing a mobile phone edition of porcessing a site showing how to visualize data using processing a site collection processing sketches a processing meta blog a collection of black'n'white monsters - coded in processing (one of them has been written by me :-) ) my own site

two really great art collections using processing

some artists using processing


make things talk

visualizing data

Processing: A Programming Handbook for Visual Designers and Artists

read more ...

extra low framerates in Processing

Nikolaus Gradwohl2009-01-29T04:45:00+00:00

when you want to write a processing sketch, that doesn't redraw several times a second, but updates the main method only once in a while (for example once per hour or minute) the following code can be used to start a thread that triggers a redraw after a delay. Just make sure the setup method calls the noLoop() methode and than start the thread calling start( millisecondsToWait );

void setup() {
  noLoop(); // <- turn off the processing loop

  start( 20 * 1000 ); // <- start the thread

void draw() {
  background( 255 );
  // draw some random circles
  for ( int i =0; i< 10; i++) {
    color c = color(random( 255 ));
    fill( c );
    stroke( c );
    int radius = int(random( 100 )+ 40);
    ellipse( random( width ), random( height ), radius, radius );     

void start( final int mil ) { //<- mil has to be final to be accessible in run() 
   new Thread() { 
   public void run() {
     while( true ) {     
        delay( mil );
read more ...