Archive for the 'Finished' Category


Monday, June 8th, 2009

This is the culmination of the Video Leaf sketch. (However somewhere along the way the video input part got left out.) The video projector casts a shadow on the wall and virtual leaves are aligned to the shadow. When the viewer taps the physical twig, the leaves in the drop from the shadow tree.

This piece was on exhibit Grey. Green. show.

Mars Altimetery Graph // ver B // Monday Banner

Monday, June 2nd, 2008

Mars Altimetery Graph ver B
run the sketch—view the code—download

How do you use it?
Primarily just watch and enjoy. A mouse click toggles the drawing of the green lines. (This looks best if you let it run for a while so I recommend downloading and running it in Processing locally.)

What is it?
This is a functioning version of Friday’s post. I thought it might help me figure out the MEGDR Viewer if I looked at the same data in a different way, so I enlisted the techniques from the Line Graph sketch. It now creates an overlapping area graph of Mars altimetry data*. I switched to continuous mode (i.e. using setup() and draw()), and had to load the data into a string instead of a byte array. I could only get the byte array to work if it was instantiated inside of draw(). Loading a 2MB file in each cycle of the draw loop made it unbearably slow.

Smith, D., G. Neumann, R. E. Arvidson, E. A. Guinness,
and S. Slavney, “Mars Global Surveyor Laser Altimeter Mission
Experiment Gridded Data Record”, NASA Planetary Data System,
MGS-M-MOLA-5-MEGDR-L3-V1.0, 2003.

Our new Indy Car team

Saturday, May 24th, 2008

Green Zebra Racing
run the sketch—view the code

How do you use it?
Move the mouse up and down to hit the gas!

What is it?
Just a fun little diversion because, hey, Indy is tomorrow!!! It’s for() loop generating some random colors underneath a PNG-24 with transparency. The car design was done for the imaginary world where my alter ego (as humble letterpress printer for Armato Design & Press) owns an Indy Car team, Green Zebra Racing.

Why is it Cool?
It turns out that A) I’m a geek, B) I’m a big racing fan, and C) you can download EPS templates of Indy Cars.

Dynamic Mask // ver C

Friday, May 23rd, 2008

run the sketch—view the code

How do you use it?
Move the mouse around to reposition the mask window. Click the mouse to switch the mask mode.

What is it?
The .mask method requires either (A) the image that will be masked and a grayscale image for the mask itself, or (B) the image that will be masked and an integer array containing the color values for the mask (this is essentially an image for the mask but it hangs out in the RAM instead of being read from a file). This sketch demonstrates how to make a dynamic mask with both techniques.

(A) Before the photo is displayed, a separate grayscale image is loaded into the program to be used as the mask. The colors in this image’s pixels[] array are then modified based on the position of the mouse. Finally, the modified grayscale image is applied to the background image with the .mask method. Because this happens in each cycle of the draw() loop, the mask functions interactively.

(B) maskArray is an array containing the same number of integers as there are pixels in the background image. All values in this array are either 0, or 255 (ints btwn 0 and 255 can also be used). Before the photo is displayed, the values in the array are modified based on the position of the mouse. The array is then applied to the image using the .mask method which interprets its values as 0=black=opaque and 255=white=transparent.

Dynamic Mask // ver B

Thursday, May 22nd, 2008

download—view the code

How do you use it?
Just move the mouse around. This doesn’t run in a browser because it requires disk access to write a file.

What is it?
Simulates a “spotlight” effect by masking an image with PImage’s mask method. The mask method requires two image files: the image that will be masked, and a grayscale image for the mask itself. This sketch demonstrates a way to make a dynamic mask… Before the photo is displayed, the mouse movements position a white circle on a black background. This is then saved as a TIF file that is immediately loaded back into the program as the mask. Because this happens in each cycle of the draw() loop the mask functions interactively.

The look of ambient light is the result of the “black” color in the alpha image being not-quite-black. It is therefor interpreted as very slightly transparent rather than opaque. The circle is filled with pure white which results in the transparent area of the mask.


Tuesday, May 20th, 2008

run the sketch(P3D) (OpenGL)—view the code (OpenGL)—download (OpenGL)

How do you use it?
Follow the on-screen instructions.

What is it?
This is based on the Rudolph helix series from Nov 2007. I’ve been tinkering with it off-and-on for a while so I decided it was time to show off the latest version. This one has an optional GUI layer built into it. This time I’m using the OpenGL renderer instead of P3D (both are posted for comparison). The weird thing is, with OpenGL the transparent pixels in the image are only transparent in one direction. With P3D, the transparency works both ways, but it doesn’t handle z-translations entirely right…

In the P3D version you’ll notice the small “farther away in space” images remain at a reduced size even when they are rotated to the front. I understand why this happens* but I’m not sure how to correct for it. Perhaps I should rotate the camera instead of rotating the coordinate space. Any thoughts?

*P3D is reducing the size of the images that are positioned on the negative z-axis. Similarly, an image with a positive z-coordinate is made bigger. This is done absolutely, without regard for the POV of the viewer; negative z = smaller, positive z = bigger. When you move the mouse left or right, you are spinning the entire coordinate matrix about the y-axis, This eventually brings the negative z-axis to the front and with it come the scaled-down images.

mondayBanner // 12 May 2008

Monday, May 12th, 2008

run the sketch—view the code

How do you use it?
-Move the mouse left and right to spin the cube.
-Move the mouse up and down to zoom in or out.
-Click and shift-click to tilt the cube.
-Space bar saves a .tif of the image. (only in Processing, doesn’t work in browser)

What is it?
A function called grid() uses two nested for() loops to determine the X- and Y-coordinates for a grid of circles. A separate for() loop translates the drawing matrix along the Z-axis and draws a grid each time. The result is a three dimensional matrix of circles.

I originally wanted to do it with spheres, but it seems that 1000 spheres is too much for the processor to keep up with. With only 125 spheres it barely worked. There was no real difference in performance between OpenGL and P3D. I have a hunch that the code could be optimized to handle larger numbers but I’m not sure where to start. Any suggestions? Should I recall the coordinates from an array? Should I go OO? I welcome comments…