Archive for the 'Monday Banner' Category

Slit-scan photos

Monday, October 6th, 2008

run the sketch—view the code

How do you use it?
space bar = start a new scan
x = toggle between color or black-and-white
s = save a .tif (doesn’t work in web browser)

What is it?
I found these thoughtful and elegant photos by Ansen Seale on Spraygraphic so I thought I’d try my hand at it. Obviously I’m not a practiced photographer like Ansen.

It is basically the Slitscan example sketch by Golan Levine and Fry that comes with Processing. I just added mousePressed() events to start a new scan, convert it to black-and-white, and to save the image.

Why is it cool?
You decide.

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.

Mars Global Surveyor: MEGDR Viewer // ver B

Monday, May 26th, 2008

My Mars topography mine Their Mars topography theirs
download the sketch folder—view the code

How do you use it?
You have to tinker directly with the code to make this do anything.
This one doesn’t run in continuous mode and it isn’t interactive so there is no link to run it in the browser. Also, it processes a 2MB data file so it would be ridiculously slow to download an run it as an applet.

What is it?
As I mentioned yesterday, I’m geeking-out about Mars right now. I was surfing around some NASA and JPL web sites looking for more digital elevation maps and found a lot of data from the Mars Orbiter Laser Altimeter. This is an instrument on the Mars Global Surveyor craft that mapped the Red Planet from 1999 to 2006. Unlike the false-color topographic map I used in yesterday’s sketch, these new files I found are NOT images. They are data files that need to be rendered into images with special visualization software. Unfortunately—or perhaps, fortunately—I couldn’t find an OS X version of any of these software packages. So I thought (encouraged by Ben Fry’s Visualizing Data book), “I bet I can write something in Processing that could view these files.” Well, it’s been a long night, I’m not sure exactly how it works, and it sure ain’t perfect, but I’ve got something. The sketch reads the altitude data from the .img files, parses that into the pixel array and displays the resulting image.

If you run this yourself, be prepared, the image size is 1440 x 720 pixels.

Why is it cool?
There are so many reasons… but one thing that really shocked me is that it’s only 9 lines of code.

mondayBanner // 19 May 2008

Monday, May 19th, 2008

run the sketch—view the code

How do you use it?
Move the mouse around. As it is currently set up, (if you are running it in Processing not a browser) a left-click will save the drawing window as a TIF. It also contains commented-out code for exporting a PDF for access to the drawing as vector objects.

What is it?
It’s actually based on the workshop demo sketch from last week.

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…

mondayBanner // 05 May 2008

Monday, May 5th, 2008

run the sketch—view the code

How do you use it?
Just move the mouse around. If you run it in Processing you can save a .png of the drawing by hitting any key.

What is it?
Today I’m starting a new weekly feature, the Monday Banner. Every Monday the will be a new header image on the blog and I will post the sketch that generated it.