Archive for April, 2008
The aquarium screensaver paradox
I’m not sure that this is an established paradox, but it should be. Here are my thoughts:
In the beginning there was the computer. It was rather worthless by itself. Just a big old calculator. No one wants a calculator.
Then, someone invented the aquarium screensaver. Computers suddenly had purpose: they supported vibrant ecosystems of fake fish and coral.
The aquarium screensaver market boomed. It became lucrative. It became competitive. The business pitted brother fish animator against brother fish animator. Companies frantically struggled to be on the cutting edge of fish-emulation technology. Other underwater creatures were demanded! “What about dolphins and sea turtles?” cried the consumer. And the aquarium screensaver companies responded with larger aquariums! And rotating views of different types of aquarium! Rare tropical fish, dolphins, turtles, jellyfish, seahorses! No creature was left behind! A rekindled interest in marine biology swept across the planet.
Image advertisements became popular. The screensaver aquarium companies were the first on board, vying for the coveted title of Most Popular Aquarium Screensaver. They survived the bursting of the ecommerce bubble. The demand for animated fish and underwater scenes never yielded. And soon the paradox emerged:
After 15 years of aquarium screensavers, who is still downloading them??
How is it possible that the aquarium screensaver market is still expanding? Browsing through websites with Google image ads, I still observe an average of one aquarium screensaver ad per day, out of perhaps 200 image ads that I allow to register in my brain. That’s an enormous percentage! I do not visit fish-oriented websites. I have shown no interest in aquariums or screensavers or sea creatures in my browsing habits. The only possibility is that the aquarium screensaver business is still thriving and has the revenue to continuously purchase advertising, even after 15 years of downloads.
Perhaps it takes 15 years for some users to become convinced that they need an aquarium on their desktop? Or perhaps dedicated aquarium screensaver fans require nearly real-time upgrades to the latest and greatest versions? Or is the number of computer users growing rapidly enough to allow for a steady influx of new customers to this magical niche market?
Someone help me understand this phenomenon.
Tutorial #3: The icosahedron-based geodesic sphere
This quick tutorial will show a more reasonable alternative to the electronsphere, which addressed the problem of distributing points evenly on a sphere. We’ll be creating a geodesic sphere (like at the Epcot center) using a subdivided icosahedron. It’s a relatively simple script and inexpensive in terms of CPU usage. Much more efficient than the electronsphere approach, though not quite as interesting.
Here’s where we’re headed: The final result
And here are the classes you’ll need: Icosahedron classes
About the geodesic sphere
The geodesic dome and sphere are often credited to Buckminster Fuller, although it is generally acknowledged that he did not invent the shape or concept, but rather investigated and expanded upon them. Read more in the Wikipedia article on geodesic spheres.
There is no one standard way to create a geodesic, but in general, the process is as follows:
- Create a Platonic solid. We’ll be using the icosahedron.
- Subdivide the faces of the Platonic solid to the desired level of resolution.
- Project the points of each subdivided face to the surface of a sphere.
Additionally, the term buckyball is used to describe the truncated counterpart to the geodesic sphere. Buckyballs are found frequently in molecular science… and also in soccer. We’ll take a look at how to convert one to the other.
Why create a geodesic sphere?
If you need to create a sphere in Processing just for decoration or whatnot, by all means, use the sphere() command. You do not need this level of complexity.
But let’s say that you need a sphere that can transform itself into a different shape, or warp itself according to some input variable, or behave like a blob… then you’ll probably want to use a geodesic. As I mentioned, its one of the most straightforward ways to create an array of points on a sphere.
Of course, you could also use this script in more physical applications: the coordinates it defines could be used to construct a real-life geodesic structure. You’d probably want to drop the points into Rhino and unfold the thing first.
What you’ll learn
I’ll touch upon the following issues in this tutorial:
- Subdividing a face to an arbitrary level of resolution.
- Constraining points to a sphere.
- Finding the centroid of a face.
- And of course, more about geodesics.
Still sound interesting?
Le Petit Prince discovered
I found a new image of Phobos, one of the moons of Mars, via this Wired article about the HiRISE orbiter. When I showed the image to my parents, they mentioned that it looked oddly similar to the planet in The Little Prince by Antoine de Saint Exupéry.
I photoshopped together this image for my own enjoyment… but if you like poignant children’s books and space imagery, maybe you’ll enjoy it too.
Check out the HiRISE website for more stunning images of Mars and its moons.
Tutorial #2: Recursive trees
Today’s tutorial is going to be shorter and sweeter than the last.
The problem we’ll address is how to structure a tree-like object in a way that’s similar to a real-life tree. It must contain a set of user-defined variables that affect the “species” of tree, but still allow some random variation within the tree’s growth.
I created something similar to this a couple years ago, but have reworked it to be simpler and more efficient. We’ll be using this Tree object in the “Lettertree” tutorial to come…
Here’s the finished product: Recursive tree
And here are the classes: Recursive tree classes
Let’s take a look at what we’ll be learning:
- Transforming points in three dimensions
- Randomizing variables
- How to structure a recursive object
And now why would we want to learn it…
The use for a recursive tree
The most obvious reason to write a tree generating script is… to generate trees. It would be fairly simple to export the coordinates of this tree into any 3D modeling software. Texture mapping and such would be tricky, because as you’ll see, this script uses segments as branches, not three-dimensional shapes. But nevertheless, it would be a nice addition to your next architectural project: some non-generic, bare trees in the landscape.
Of course, branching structures are used in more than just trees. Let me know if you think of other uses. Maybe something like… plotting three-dimensional decision making graphs? Where the sum of a user’s choices is represented by a single point within a cloud of possible outcomes? That could be a nice way of comparing the results of a survey in three dimensions.
And now, let the games begin…
Tutorial #1: More than one way to skin a sphere
This first tutorial will address the question of how to evenly distribute points on a sphere. It’s not as simple as it sounds.
I’ll be addressing one method today, which I’ll be calling the electronsphere. The idea is this: treat each point as if it were an electron – repelling all other electrons around it – and limit its maximum distance from a center point. You should end up with a pretty well-distributed sphere of points. The trick will be how to “skin” (triangulate) the sphere. More on that later…
For now, take a look at where we’re going: The final result
And download the classes: Electronsphere classes
When you’re looking at the example, give it about 30-60 seconds to resolve the positions of the electrons (longer on slower computers, waayyy faster within the Processing environment), then you’ll see triangles start to appear between the points on the sphere. Both processes are iterative and random, and therefore quite unpredictable, but they should produce quasi-accurate results.
Why should I distribute points on a sphere?
I’m not really sure. The first time I encountered the problem I was in need of a spherical shape that could be warped or dented. I used a more sensible approach than the electronsphere, which I’ll show in a later tutorial, but the electronsphere is much more exciting. By changing the repulsion between electrons, you could potentially use this to create a sphere of points that reacts to mouse movements or other interactions and warps a mapped image accordingly. That would be worthwhile.
What you’ll be learning
We’ll address all of these issues in this tutorial:
- Extending classes
- Node interaction: repulsion forces
- Using vectors to constrain points and forces
- Finding the circumcenter of a three-dimensional triangle (face)
- Back face culling
- And in general, how to set up an iterative Processing application
Let’s get started…
Read more…
Paul Bourke
I should give a nice big link of thanks to Paul Bourke and his excellent website, which has been helping novice programmers like me find answers to their geometry questions for many years.
Paul Bourke was one of the first people to publish clear, concise, down-to-earth solutions to common math questions from a computer programming standpoint. While in college, I took a class taught by Golan Levin, who introduced us to the website.
When other sites will be using matrices and trigonometry to approach a simple problem, Paul Bourke’s solutions rely almost solely on basic arithmetic. This is a good thing.
Whenever you see a variable prefixed with a “pb” in my code, that’s my acknowledgment that the solution was derived from the ones posted on his site.


The article has
one response