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

boids

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;
        break;
      }
    }
    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.

particles

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
arround

fireflies

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() {
  size(320,200);
}

int col = 0;

void draw() {
  background(col);
  stroke(255,0,0);
  line(0,0,width, height);
  line(0,height,width,0);
}

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

void keyPressed() {
  exit();
}

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

http://www.processing.org/ the mother of all processing sites :-)

http://www.arduino.cc/ a language and a microcontroller board that that go very well with processing

http://mobile.processing.org/ a mobile phone edition of porcessing

http://www.openvisuals.org/ a site showing how to visualize data using processing

http://www.openprocessing.org/ a site collection processing sketches

http://www.processingblogs.org/ a processing meta blog

http://www.rmx.cz/monsters/ a collection of black'n'white monsters - coded in processing (one of them has been written by me :-) )

https://www.local-guru.net/blog/tag/processing my own site

two really great art collections using processing

http://www.complexification.net/gallery/

http://abandonedart.org/

some artists using processing

http://www.flight404.com/blog/?cat=1

http://www.toxi.co.uk/

http://www.benfry.com/

http://www.groupc.net/

Books:

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() {
  size(300,300);
  smooth();
  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 );
        redraw(); 
      }
   }
 }.start();
}
read more ...