Code from the workshop will be online here: workshops/080310_khio. Check out Kuler for RGB color goodness.

Inspiration for media architecture:

3 Comments »

The following Processing example shows how to set up a separate thread for loading images into a sketch. I wrote it up in response to this post on the Processing forums, figuring it will be useful to some of my students too.

Code: ThreadImageLoader.pde

Read the rest of this entry »

9 Comments »

We’re making good progress at the HyperWerk digital fabrication workshop, see the new Fabbing @ HyperWerk Flickr group for details.

Hyper0802 201 Martin Fuchs - Polygon form Hyper0802 171 Martin Fuchs - Polygon form Hyper0802 182 Philip Whitfield Hyper0802 003 Martin Fuchs Hyper0802 102 Leander Herzog Hyper0802 095 Martin Fuchs Hyper0802 133 Roland von Tessin

No Comments »

I’m at HyperWerk in Basel, Switzerland teaching a workshop in parametric design for the next two weeks. Files will be uploaded to the following address:
http://workshop.evolutionzone.com/workshops/080218_hyperwerk/

Task for the day:

  • Find an example of a project involving parametric design or rapid manufacturing.
  • Prepare to give a 3 minute presentation of the project and explain why you think it’s a good example of parametric design.

No Comments »

Turns out Java has no mechanism for discovering the names of disk volumes. You can use java.io.File.listRoots() to get the root paths for multiple disks, but you can’t auto-discover their names.

Here’s a quick hack that will work on Windows. It uses Runtime.getRuntime().exec() to run “cmd /c dir “, the output of which is parsed to get the volume name.

import java.io.*; 

void setup() {
  println("Testing getVolName");

  String path="D:";
  println("Volume name for "+path+" is: "+
    "'"+getDiskVolumeName(path)+"'");
}

public static String getDiskVolumeName(String path) {
  String volname="Unknown";
  String check="Volume in drive "+path.charAt(0)+" is ";
  try  {
    Process p=Runtime.getRuntime().exec("cmd /c dir "+path);
    //p.waitFor(); 

    BufferedReader reader=new BufferedReader(
      new InputStreamReader(p.getInputStream()));
    String line=reader.readLine();
    while(line!=null) {
      if(line.indexOf(check)!=-1)
        volname=line.substring(line.indexOf(check)+check.length());

//      System.out.println(line);
      line=reader.readLine();
    }
  }
  catch(Exception e1) {
    println("Failure: "+e1.toString());
  }
  return volname;
}

No Comments »

I am teaching a 3-day workshop in Digital Architecture at the Oslo School of Architecture & Design (AHO) this week, as part of a course by Søren Sørensen. The workshop will give an introduction to Processing, with a focus on synthesis of spatial form. If time permits we’ll also look briefly at Rhinoscript.

Be sure to look at the page I have prepared with links related to computational architecture. Code will be uploaded to:
http://workshop.evolutionzone.com/workshops/080211_aho.

Workshop contents
  • Basic Processing syntax
  • Simple animation
  • Control structures: If / else, loops, keyPressed(), mousePressed()
  • Transformations: translate(), scale(), rotate()
  • Complex drawing: beginShape(), endShape()
  • Data structures: Arrays, classes
  • Polygon mesh generation
  • Output: PDF, STL, DXF
Possible advanced topics

1 Comment »

I just finished a set of concerts with Alexander Rishaug, starting in Berlin at CTM.08 / Generator.x 2.0: Audio-Visual. This week we did two more gigs, first at VJ picks DJ in Bergen and finally on our home turf at Kabinett #3 in Oslo. For an impression of the set you can have a look at the clip above, posted by Pablo Sanz. For a short interview you can take a look at WatchBerlin's coverage of the concert and exhibition opening.

It was great to play with Alexander and develop our collaboration further, his cinematic soundscapes are a treat to work with. Audience responses seem to indicate that we’re doing something right, so hopefully we’ll find more chances to play together in the near future.

Rishaug & Watz- - Kabinett #3 GX20 Concert 0006 Alexander Rishaug & Marius Watz

GX20 Concert 0005 Alexander Rishaug & Marius Watz GX20 Concert 0002 Alexander Rishaug & Marius Watz

Kabinett poster by Diogo Valerio / photos from performance at Generator.x 2.0

3 Comments »

Quick Chick: A game made in Processing

Fan Fan, Knut Karlsen, Natacha Ruivo: Quick Chick - a Processing game

Over on Fan Fan’s blog I just found documentation of one of the funniest games the students made: “Quick Chick” starring Billy the Chick who must dodge poisonous falling apples and thorny flowers while making his way home before dark.

Quick Chick is a classic scrolling-landscape type game with obstacle avoidance and good gameplay. Graphically it’s so smooth you’d swear it was done in Flash (it’s JAVA2D). And the graphics are some of the cutest I’ve ever seen in a Processing sketch.

Quick Chick: A game made in Processing

5 Comments »

Sample code to use mouse wheel events in Processing.

Read the rest of this entry »

1 Comment »

Here is a simple example showing how to use unlekkerLib to output and input 3D geometry in STL format.

// STLBoxes.pde - demonstrates how to use unlekkerLib to
// import / export STL geometry data.
//
// Marius Watz - http://workshop.evolutionzone.com/

import unlekker.data.*;

STL stl;

public void setup() {
  size(400,400, P3D);
  frameRate(25);
  sphereDetail(12);
}

public void draw() {
  translate(width/2,height/2);

  if(frameCount==10) outputSTL();
  else if(frameCount==11) readSTL();
  if(frameCount<12) return;

  background(0);
  noStroke();
  lights();
  rotateY(radians(frameCount));
  rotateX(radians(frameCount*0.25f));
  fill(0,200,255, 128);
  stl.draw();

}

public void readSTL() {
  stl=new STL(this,"Boxes.stl");
  stl.normalize(400); // scale object
  stl.center(); // center it around world origin
}

public void outputSTL() {
  float rad;

  stl=(STL)beginRaw("unlekker.data.STL","Boxes.stl");
  for(int i=0; i<200; i++) {
    pushMatrix();
    translate(random(-200,200),0,-random(400));
    rotateX(((float)(int)random(6))*radians(30));
    rotateY(((float)(int)random(6))*radians(30));

    rad=random(5,25);
    if(random(100)>5) box(rad,random(50,200),rad);
    else sphere(rad);
    popMatrix();
  }
  endRaw();
}

10 Comments »