
A Dome Home
Vladimir Bulatov is one brilliant guy. He wrote the most
elegant dome generator PROTO I've ever seen, and allowed me to use it to
generate some geodesic spheres and domes. Math fanciers, please note: the dictionary definition of "geodesic
dome" lets you get away with murder.
As you increase the number in the "order" field in Vladimir's example world (contained in the dome generator file) the number of vertices and faces on the sphere increases.
It's probably more useful for real-world world builders to have static domes, so I wrote a little code that
dumps the points and coordIndexes to the console, where they can be copied and pasted into files.
And then, since Vladimir's code only generates one patch (and makes 19 more copies of it, rotated appropriately,
to make the sphere), I read up in the spec about the VrmlMatrix object. In the process, I discovered
that Chris Marrin didn't build the VrmlMatrix for people who know how to work matrices. He built it
for people like you and me who used to know how to work matrices. Anyhow, it was really easy to duplicate
the Transforms and USEs so that all the points are put into the sphere and you can print
them out.
Making the hemispheres is easy, but tedious. For the odd-numbered orders, there's a continuous line that bisects
the sphere (in fact, there's several of them). Vladimir figured out the rotation that would put one of those lines
on the Y=0 plane. So all you have to do if you're impatient and want a higher order dome before I get around to
it is remove all the coordIndexes that refer to any point whose Y is less than zero. For even-numbered
orders, there's no continuous line, so you need to find the negative Ys that are closest to 0, and change them
to 0 wherever they occur. Then eliminate all the coordIndexes that refer to points with negative
Y values, just like before.
Incidentally, Vladimir originally planned to use the sphere as an exploding sphere, so each triangle is separate. I decided people would rather live in their domes than have them explode, so I ran it through Chisel to reduce the points and edges. Because math functions on real computers are imprecise, I also reduced the precision to 4 decimal places, and that resulted in eliminating a few more "hidden" duplicates. If you make a hemisphere, run it through Chisel again to eliminate the points that aren't used any more.
Here's the ones I've finished so far:
Putting support struts on your dome
Here's a way to put external struts on these domes that a couple of people thought was mildly clever when I
showed it at the Huntsville VRML Users Group. First of all, using Cylinders
for struts is a seriously bad idea unless your dome is small. It slows rendering speed to a crawl. A lot of times,
particularly for a distant dome, you can get away with IndexedLineSets.
Once you've figured that out, the rest is pretty obvious. Put down your dome. Then make another Shape
node in the same location, but scale it 1.01 in all directions (for struts on the outside) or 0.99 (for struts
on the inside), USE the Coordinate node from the dome, and copy the coordIndexes
from the original.
One more step: since a coordIndex of 0,1,2,-1 will create three edges when you use it in
an IndexedFaceSet, but only two lines when you use it in an IndexedLineSet (the
missing line is the one that goes from 2 to 0), you'll need to duplicate your first number before the -1, so it'll
look like 0,1,2,0,-1. That'll give you too many lines, but it's easy enough to break up the polylines
into individual lines and get rid of the duplicates. Or if you want to save the trouble, download my wireframe
utility that turns IndexedFaceSets into IndexedLineSets. Here's an example of what it
looks like.
That's it. Enjoy your new dome home.
Oh. Before I forget, you might want to see if having the whole dome connected is a good idea or a bad idea.
It might be that a high-order dome would be easier to navigate around and through if you cut it into pieces. It
shouldn't be that hard to find the points that have positive X and Z, negative X and Z, positive X and negative
Z, and negative X and positive Z and make 4 IndexedFaceSets out of your dome.
![]()
-- Bob Crispen
-- Sunday, November 15, 1998