virtual chalkboard in processing

Posted by Nikolaus Gradwohl Tue, 09 Mar 2010 18:32:48 GMT

today i coded a little processing sketch that allows to make chalk like drawings

click here to give it a try

chalk-drawing

Tags  | no comments

Tweet This! submit to reddit Digg!

How To Make a 3D-Paper Model from a Heightfield in Processing

Posted by Nikolaus Gradwohl Sun, 07 Mar 2010 14:41:39 GMT

I just wrote a little processing sketch that takes a height field like this

heightfield

calculates a pdf containing something like this

example

which can be cut out and sticked together to a 3d model like this

finished model

Read more...

Tags , ,  | 2 comments

Tweet This! submit to reddit Digg!

line detection with hough-transform

Posted by Nikolaus Gradwohl Tue, 19 Jan 2010 02:23:00 GMT

I wrote a small processing sketch to work out how linedetection using hough-transform works.

click here to see it in action and get the sourcecode. the code is not optimised for speed but for my understanding :-) so don't complain if it doesn't work on live-video.

the algorithm takes a image that has run through an edge detection algorithm and turned into a black/white image and find where things like edges or circles are by converting the pixels from imagespace to a parameterspace where such detection is much easyer.

for each pixel that is set in the source image a set of parameters that satisfy the formular r = x * cos(roh) + y * sin(roh) is calculated and r and roh are plotted as the parameterspace image

every line in the input image results in a bunch of lines in the parameterspace that have a common intersection point.

in my example i use a input image like this

input

calculate how it looks in parameter space

parameter space

and then reconstruct where the lines are

reconstruct

Tags , ,  | no comments

Tweet This! submit to reddit Digg!

Printed Processing sketch

Posted by Nikolaus Gradwohl Wed, 13 Jan 2010 05:05:04 GMT

I just printed the first stl file that i generated using a processing sketch.

I used the unlekkerlib to export a stl file from a sketch that generates simple 3d spiral, used blender to add a socket and printed it on my makerbot. Skeinforge complained about some invalid triangles, but beside that it worked surprisingly well.

This is what it looks like in blender rendered

and this is what the makerbot made of it printed

and this is the processing-sketch i used to generated the spiral

import unlekker.data.*;

void setup() {
  size(300,300,P3D);
  noLoop();
}

void draw() {
  translate(width/2,height/2);
  background(0);
  fill(255);
  lights();
  noStroke();
  //stroke(255);
  beginRaw("unlekker.data.STL","guru.stl");
  beginShape(QUAD_STRIP);
  for( int i =0; i < 100; i++ ) {
    for(int a=0; a < 36; a++) {
      float r = 10 - map(i,0,100,0,10);
      vertex( r * sin( radians( a * 10 )) + sin(radians(i*10)) * 10, 
              -i*1, 
              r * cos(radians(a*10)) + cos(radians(i*10)) * 10);

      int j = i+1;
      vertex( r * sin( radians( a * 10 )) + sin(radians(j*10)) * 10, 
              -j*1, 
              r * cos(radians(a*10)) + cos(radians(j*10)) * 10);
    }
  }
  endShape();
  endRaw();
}

Tags , ,  | no comments

Tweet This! submit to reddit Digg!

Deploying Processing apps using WebStart

Posted by Nikolaus Gradwohl Mon, 11 Jan 2010 10:22:22 GMT

To deploy a processing sketch via java webstart export the sketch as an application (i used my randomlines sketch and exported it as a linux application).

then i wrote a simple jnlp file and copied the files to my webserver. The only thing thats left is providing a link to the jnlp file like this.

click here to dowload and launch the application

More info on jnlp and webstart can be found here

test.jnlp

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
    <information>
        <title>Processing Test</title>
        <vendor>guru</vendor>
        <icon href="http://www.local-guru.net/jnlp/randomlines/randomlines.png"/>
        <desktop/>
        <offline-allowed/>
        <shortcut online="false">
              <desktop/>
        </shortcut>
    </information>
    <resources>
        <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="http://www.local-guru.net/jnlp/randomlines/lib/randomlines.jar" main="true" />
        <jar href="http://www.local-guru.net/jnlp/randomlines/lib/core.jar" main="true" />
    </resources>
    <application-desc
         name="ProcessinTestApp"
         main-class="randomlines"
         width="300"
         height="300">
     </application-desc>
     <update check="background"/>
</jnlp>

Tags , ,  | no comments

Tweet This! submit to reddit Digg!

Smiley-O-Mat

Posted by Nikolaus Gradwohl Fri, 08 Jan 2010 04:20:23 GMT

I just finished my Smiley-O-Mat - it's a tin-box with 3 turning knobs that allows you to controll the appearence of a smiley. With 3 simple turns I can now tell your co-workers, familymembers, ... how you feel at the moment and if it is wise to talk to me right now :-)

The controllerbox is made with an arduino, the smiley generator is written in processing, and the turning knobs are printed on my makerbot

This is what the controller looks like controler box

and here are some smileys i generated

smiley1 smiley2 smiley3 smiley4 smiley5 smiley6

Read more...

Tags , ,  | no comments

Tweet This! submit to reddit Digg!

Floating Processing cloudes with minim

Posted by Nikolaus Gradwohl Mon, 04 Jan 2010 02:59:54 GMT

I made a simple example to test the sound input features of minim, an audio library for processing.

I took one of the cloudes i wrote for my ical-flowers and wrote a simple sketch that makes it float to the right whenever someone blows into the microphone.

floating coude

Read more...

Tags , ,  | no comments

Tweet This! submit to reddit Digg!

Falling letters in processing

Posted by Nikolaus Gradwohl Thu, 17 Dec 2009 05:10:59 GMT

My latest processing-sketch features some letters that are dropping from the top of the window to the bottom and form a word.

click here to see it in action

hello

Tags  | no comments

Tweet This! submit to reddit Digg!

plasma in processing

Posted by Nikolaus Gradwohl Wed, 16 Dec 2009 04:39:59 GMT

I wrote another simple and pretty useless (i mean simple, pretty and useless :-)) sketch in processing. I wanted to see how the noise function reacts so i wrote a sketch that draws plasma. Press any key to change between color and grayscale mode.

colored plasma grayscaled plasma

Tags  | no comments

Tweet This! submit to reddit Digg!

Random Lines in Processing

Posted by Nikolaus Gradwohl Tue, 15 Dec 2009 01:50:49 GMT

I made another completely useless sketch in processing

click here to see the lines move in action

randomlines

Tags  | no comments

Tweet This! submit to reddit Digg!

Older posts: 1 2 3 ... 8