Random numbers with MobileProcessing

Nikolaus Gradwohl2009-01-25T08:14:00+00:00

I wrote my first sketch in MobileProcessing. MobileProcessing is a processing dialect, that can be used to write apps for java-capable mobile phones.

The application can be used to generate random numbers. every key-event shows a new random number.

/**
  a random number generator by
  <a href="https://www.local-guru.net/blog">Guru</a>
*/

PFont font;
int rnd = 0;

void setup() {  
  font = loadFont( FACE_PROPORTIONAL, STYLE_PLAIN, SIZE_LARGE );
  textFont( font );
  textAlign( CENTER );
  fill(0);
  rnd = random(0,100000);
  noLoop();
}

void draw() {
  background(255);
  text( "\n\n\n"+rnd, 0, 0, width, height );
}

void keyPressed() {
  rnd = random(0,100000);
  redraw();
}
read more ...

Processing sketch on fire

Nikolaus Gradwohl2009-01-18T07:50:00+00:00

I just made another little demo in processing. in fact i rewrote a little demo i did 15 years ago in pascal on a dos-box

fire-screenshot

read more ...

Training Bike Visualization

Nikolaus Gradwohl2008-12-08T14:58:00+00:00

i wrote a processing sketch to visualize and record sessions on a training bike. To calculate the rotation-speed of my training bike i hooked up 2 reed-switches to my arduino and taped them to my training bike. Than i sticked a rare earth magnet on each pedal.

the processing sketch draws a small figure on a bike which is animated at the same speed as the bike.

the sketch also records the timestamps to a log file for later analysis.

training bike

read more ...

processing ical-flowers

Nikolaus Gradwohl2008-12-06T22:42:00+00:00

I just made a processing sketch using my ical4p library. The programm draws a flower for every event in a given ical-file. The more events the calender has, the more beautifull the flower-garden is :-)

ical-flowers

read more ...

ical4p Processing lib

Nikolaus Gradwohl2008-12-06T22:26:00+00:00

i have written a small wrapper around ical4j written by Ben Fortuna. This allows to write processing sketches, that visualize data from ical files.

i included a small example in the lib showing how to draw a timeline based on an ical file.

i also have set up a project-page for it. The libray is released under the LGPL.

read more ...

Processing Library Template for ant

Nikolaus Gradwohl2008-12-03T18:00:00+00:00

Yesterday guidelines for developing a processing library have been published including a template for eclipse. Since i don't use eclipse i wrote a small template myselft using ant. So all the vim/TextMate/UltraEdit/whatever-users out there who want to make cool processing libraries check out my template

read more ...

ColorMatcher Processing lib

Nikolaus Gradwohl2008-11-23T12:08:00+00:00

a while ago i wrote a processing sketch that allows to match some colors in a live video image.

now i translated the code into a processing library and made a project-page for it. The libray is released under the LGPL.

read more ...

Processing monster

Nikolaus Gradwohl2008-11-18T19:11:00+00:00

This time i haven't found a monster - i made one. in processing.

monster screenshot

read more ...

Fun with sine and cosine

Nikolaus Gradwohl2008-10-24T06:22:00+00:00

I just played a bit with sine and cosine and got a very nice picture. the code takes some time to run, so i post a pregenerated image this time.

<typo:lightbox src="/img/guru/sincosfun.png" thumbsrc="/img/guru/sincosfun_prev.png"/>

float r;
void setup() {
  size(600,600);
  smooth();
  r = max( width/2, height/2) * 0.8;
  noLoop();
}
void draw() {
  background(0);
  stroke( 255, 2 );
  strokeWeight(2);
  lines( 4 );
  filter( BLUR, 4 );
  stroke( 255, 6 );
  strokeWeight(1);
  lines( 2);
}

void lines( float factor ) {
  for ( int j = 0; j < 360 * 10 * factor; j++ ) {
    float i = j/factor;
    line( width/2 - r * cos( radians( i / 2.1 )), 
          height/2 - r * sin( radians( i  )),
          width/2 - r * sin( radians ( i / 1.01  )),
          height/2 - r * cos( radians( 180 - i ))
    );
  }
}
read more ...

Linedemo in processing.js

Nikolaus Gradwohl2008-10-20T19:47:00+00:00

Todays usless processing-sketch is written in a processing dialect written in java-script. The demo shows a rotating line and uses the canvas element. So if you can't see anything try another browser.

read more ...