Don Havey

Sustainably harvested information

Archive for May, 2008

Finding inspiration  

John Campbell must be one of the most loved people on the internet. He deserves it. Here is his comic guide to finding inspiration.

And in case you haven’t already tried it, it’s time you started reading Pictures for Sad Children.

The article has

no responses yet

Written by Don

May 15th, 2008 at 9:30 pm

Categories: Etcetera

Tags: , ,

Stay tuned  

I’ve been hella busy lately, but do not fear…

Coming soon:

  • Computer vision. Get your webcams ready. Birds landing on your shoulders, drawing with video, all that good stuff.
  • More fun with typography. Manipulating text with… video? Or with space filling algorithms? Or making text that runs away when you try to read it? Something like this? I haven’t decided yet.
  • Some real uses for the applets I’ve already discussed.

Stay tuned!

The article has

no responses yet

Written by Don

May 15th, 2008 at 8:29 pm

Categories: Etcetera

Tags: ,

Thinking about buying a new car…  

Bored tonight, so this is what I made:

Should you buy a new car?

It’s a pretty basic calculator that helps you understand the relationship between fuel economy and a vehicle’s long term value. Its not as obvious as it sounds. Javascript powered.

The article has

no responses yet

Written by Don

May 10th, 2008 at 10:24 pm

Another Game of Life  

Game of Life textureIt seems that everyone who has ever programmed in Java has, at some point, created a variation on John Conway’s Game of Life. Well I wouldn’t want to break with tradition. Here’s mine.

This is just a code dump, but the applet is so simple that it doesn’t really require a tutorial anyway. I’ll paste the code directly into the post below, but if you must download a zip file, you can click here.

Here’s the demo: With motion blur / Without motion blur
(Press spacebar to pause, toggle cells by clicking them with your mouse, then press spacebar again to animate.)

My take on it

Like I’ve mentioned before, the motion blur trick is a little tired. But the idea I had with this applet was to use the automaton to generate some interesting 8-bit-esque texture maps. Since we’re wrapping the cells around the edges of the applet, a screen capture of any frame can be tiled seamlessly. The example above was made from a 40 cell x 40 cell square, reduced to be a 40px x 40px tile, which was in turn defined as a pattern in Photoshop and used to fill the image.

Although the example above is made from a tiny tile, I think it looks pretty nice. Interesting wallpaper, if only conceptually. Certainly not meant to be used for realistic bump mapping or anything.

Want the code?

Read more…

The article has

no responses yet

Written by Don

May 5th, 2008 at 4:54 pm

Tutorial #7: Voronoi diagrams  

Voronoi previewSunday is looking a little overcast, a little gloomy, and a lot like a good day to tackle a complicated tutorial: Voronoi diagrams.

I’m sure you’ve seen them before. Given a set of points, a Voronoi diagram defines a series of cells surrounding each point. Each cell contains all points that are closer to its defining point than to any other point in the set. Subsequently, the “borders” of the cells are equidistant between the defining points of adjacent cells. I’ll give you a diagram later.

I haven’t used my Voronoi class in an exciting applet yet, but it has plenty of uses… mostly functional, some aesthetic. Golan Levin did a series of portraits using Voronoi diagrams. More commonly, they’re used in mapping applications.

But first, the moment you’ve all been waiting for: The final result

And how we get there: Voronoi classes

More introduction

Say you have a map of your city, and on it you have located a set of points representing every fast food restaurant. Creating a Voronoi diagram from these points would enable you (on your walk through the city) to know which restaurant you’re closest to at any given time. Of course, an application that simple could be solved more efficiently via other methods, but let’s raise the stakes a bit. What if you want to know the percentage of your walk that will be closest to one particular McDonalds. Suddenly, without a Voronoi diagram, this is tricky. With a Voronoi diagram, however, it’s a simple matter of intersecting the line that represents your walk with the cell that surrounds that particular restaurant.

Voronoi diagrams can also be used to make maps, not just analyze them. Say you have a set of points that represent air quality sample locations. To quickly generalize the sample points into a local map… bam! Voronoi diagram!

There are other more abstract information processing uses for the diagrams as well, but I’m not going to get into them here.

A few more notes

  • The most efficient way to create a Voronoi diagram is via Fortune’s sweepline method, which reminds me of how police departments use lines of people to do a walking search of an open area. We’re not going to use that method here. The math is less intuitive.
  • The dual graph of the Voronoi diagram for a set of points is called a Delaunay triangulation. It’s a pretty great way of generating a mesh from a set of points, because it allows for an efficient non-uniform distribution of detail.
  • All Voronoi cells are convex hulls, assuming that the boundary we are working within is a convex hull. This will be important.

Still alive?

Read more…

The article has

3 responses

Written by Don

May 4th, 2008 at 11:23 pm

Life is carbon  

My new favorite blog is lifeiscarbon. It’s full of content as sexy as its name implies. Remind me to write a post on the brilliance of that phrase. Life is carbon.

The article has

no responses yet

Written by Don

May 4th, 2008 at 6:54 pm