Archive for the 'Travel with SL' Category

Sep 11 2008

Case Study: USGS terrain in OpenSim, a GIS approach

ABSTRACT: When creating sims based on real-world terrain, there’s usually a lot more extent and detail available than is typical when one must hand craft every region landscape. When compared with commercial multi-user virtual environment (MUVE) hosting, OpenSim has extremely low marginal cost for adding more simulator regions. Whenever a real-world region of interest has free 1/3 arc-second DEM data available for download from the USGS seamless server, then with a bit of GIS help from someone at a local university or interested government office, the free DEM data can be converted to a fine 1/10 (1:10) scale sim of terrain in OpenSim. This case study takes an idea posted to a blog, and turns it into a sim of 54-regions in OpenSim based on real-world terrain available at a 10-meter posting interval. To run all the regions, one first obtains OpenSim, then downloads the 54 terrain tiles, the 54 region definition XML files, and a loader script available from this post. The region definition files will likely need to be regenerated with the supplied PHP script to point to your machine’s IP address.

The Case Study tour video is nearly 10 minutes, and if it doesn’t embed in your browser is here at

Two days ago I was intrigued by Brian White’s posting of a Tutorial for real-world terrain in OpenSim and I followed several of his well-documented steps. Then I read all the way to the end of his posting and realized that he wasn’t fully satisfied with the results. I’ve helped a couple of folks with generating specific terrains before, and Orcas looked like an intriguing bit of topography–sort of a miniature version of how I imagine Greenland might look in, say, a couple decades…

So without an intent to cross-talk Brian’s posting, I’ll offer my own parallel perspective on how I’d approach making a recognizable, maybe even fun-to-have-around model of the Orcas Island in OpenSim. Starting from where he did, I’d like to emphasize the profound opportunities for following this approach, as it would work virtually anywhere in the continental USA (CONUS) where the 1/3 arc second seamless DEM is pretty much complete. In other words, what I’ll show here could be applied in an hour or so’s effort to produce an OpenSim version of Yosemite Valley, for example.

First, choose thy locale. The USGS seamless server is a worldwide resource, but the greatest detail available seems to be in the “lower 48” states. A digital elevation model (DEM) with postings on 1/3 arc second interval has samples about every 10 meters in Y (north-south) and more closely spaced than that in X (east-west) everywhere off the equator. The 1/9 arc second data that Brian mentioned was actually not available for Orcas, although some urban areas may have it at this time. In this case, Orcas Island offers a nominal 10-meter DEM downloadable from server.

Second, define thy scale for the sim. If one will be hosting on a commercial sim, even like Linden’s Open Space sims in Second Life’s Agni grid, then there are very strong reasons to scale things down and perhaps pack everything into a single region or four. With OpenSim, unless you’re going to have tons of prims and game-grade dynamics running, it may be possible to balance the number of regions you set up with the terrain quality that you desire. For the Orcas, I downloaded the islands (using the default format which seemed to be an ESRI GRID) and explored them in ESRI ArcGIS. With that I had the sense that I wanted more or less 24 km in X, and 16 km in Y, to cover the Orcas. Since OpenSim allows me to load floating-point terrain samples on a 1 meter posting interval, I knew that my available (1/3 arc second) DEM would support a 1/10-scale sim, analogous to a 1:10 scale map. That way, I would not discard too much of the terrain information on its way into OpenSim.

Third, do the math to tile the regions. It’s not too hard, but it’s fairly unforgiving. After a bit more ArcGIS exploration, I found a way to crop the DEM to exactly 23.04 km in X, and 15.36 km in Y. Sounds wierd, or compulsively precise? Not really. Since each of my terrain samples was planned to be on a 10-meter grid interval in real-world, and my sim scale is 1/10, that means that every region would cover a 2560-meter square, or 2.56 km on a side. The dimensions that I chose were simply six regions north-south and nine regions east-west, for a total of 54 regions of 1:10 scale sim.

Fourth, get your DEM gridded. Sure, it comes from USGS that way, but the seamless server works world-wide, and that requires a geographic (Longitude / Latitude) way of defining its coordinates. To do this rigorously, I used Geographic Information Systems (GIS) software to re-project the DEM from geographic, the way it downloaded, into a projected grid [World Geodetic System 1984 (WGS84) datum, Universal Transverse Mercator (UTM) zone 10 north projection, with distances measured in meters]. The UTM grid system is defined world-wide, with the proviso that at any given spot, only one of the sixty (60) grids in the system would be the best choice. For the Orcas, it’s zone 10. For the reprojection process, I used a remote sensing package, Leica ERDAS Imagine that provides precise control over both the reprojection and the resulting data’s sampling interval. I used ERDAS Imagine to grid the UTM-projected DEM into a Cartesian grid of 10-meter interval in both X and Y, and cropped the projected data to 2304 by 1536 samples.

Fifth, dice the DEM. This is necessary for multi-region sims where your grid has more than (and exact multiples of) 256 samples in X or Y. ERDAS Imagine dices, so i used it. If you’re trying this in Photoshop, be sure to keep the pixels in 32-bit (single precision) floating point values, and don’t go to integer grayscale or the flatter terrain will get stair-step artifacts. The naming convention used in ERDAS Imagine starts at the top row and increases downward for Y, and also puts Y first then X in the tile name so that the south-westernmost of the 54 regions is called “orca_6_1”

Sixth, reflect each diced DEM tile, this reverses the direction of samples in Y dimension. What starts out as the top, northernmost row is moved into the bottom-most position, and vice-versa. This does not change the size of the tile, nor any of the gridded elevation values themselves. Another way to describe this is to flip the image around the X axis. ERDAS Imagine has a geometric correction function that allows one to specify this as an affine mapping, which I did. I’d expect that most of the world uses GIMP or Photoshop to do this, too. Although it would appear that this will scramble the terrain, it is necessary to do this to adapt the data to the sequence in which OpenSim reads the terrain file when loading it into the region.

Seventh, export the reflected DEM tiles to f32 raw binary. After trial and error, I found that using IEEE 32-bit single precision float with Motorola “swapped” byte order works for OpenSim. This is true even though my machines (both Windows and Ubuntu) are running Intel processors. Go figure.

Eighth, place the f32 terrain tiles in a directory within OpenSim’s ./bin for easiest referencing in the region definitions. For this case, I have prepared 54 tiles for Orcas that can be downloaded, unzipped, and placed in ./bin

Ninth, create the appropriate region definition XML files in OpenSim’s ./bin/Regions directory. Long before one gets up to 54 terrains, it makes sense to have a bit of code to help this process. I started modifying a sample provided with OpenSim a while ago, and include it, along with 54 region files for Orcas that can be downloaded, unzipped and used to replace your Regions directory.

Tenth, create a command script to load the terrain once your 54 regions are running. I include such a script that can be downloaded and invoked from the OpenSim console with “command-script terrain54.txt”.

Et Voila: A 10-minute tour of most of the sim has been recorded and is being uploaded to YouTube

No responses yet

Apr 09 2008

Sailing: Gualala to the Northern Continent

Published by under SL In General,Travel with SL

Just a note to describe more fun sailing with the new Windlight viewer, and the Wee Tiny Tako 3.2 (that’s a version, not its length. The actual craft is sporting a 2.25-meter waterline!

The DD13 Tako 3.2 For my Dad’s birthday this week, I took a sail to the Northern Continent.

Map of start and end of sailing trip Along the way I sailed through ANWR The Wee Tiny Tako vs. Big Oil
Finally, I met some unpleasantly private waters that were poorly marked, and my craft reverted to my Inventory, leaving me sitting on a coral reef. Just before this mishap, I enjoyed some fresh winds up to 12 knots northerly and boat speeds up to 7 knots.
How it all ended 40080408In Northern waters
Plenty of fun!

No responses yet

Apr 07 2008

Windlight wanderings

Published by under SL In General,Travel with SL

This post has little to do with OpenSim, except to share the enjoyment of the new viewer that works well enough with sculpted terrain megaprims in OpenSim. This evening was simple diversion, a novel experience of sailing in a Wee Tiny Flying Taco, learning how to sail it better, and navigating the ancient inland seas from Gualala through Rosedale and Kapor to the timeless shores of DaBoom. Virtual weather was very pleasant with a westerly 7 knot breeze. I moored off Stanford’s southern shore and strolled a bit, and got to see some square-rigged pirate ships up close. The tiny Taco fits well under bridges and as always, Second Life from tiny eyes seems bigger and perhaps more wondrous.

Inland sea sailing in Windlight 20080407 More Windlight sailing 20080407

One annoyance, for me, was that the new viewer seems to have altered the rules for focus-and spin when mousing. While learning how to build detailed interiors of structures, I really got used to the click-to-focus, followed by an Alt-click to rotate point-of-view around that clicked focus point. Now that seems lost and I miss it very much. It matters not too much with sailing, but the way it works now would seem crippling to me when it came time to build fancy structures. So for that, maybe OpenSim folks will want to keep the installer fairly close at hand!

No responses yet

Oct 02 2007

Angling toward 10 Million accounts

Published by under SL In General,Travel with SL

Not as sad as might appear!

Silence is not becoming of a little blogging avatar. I’ve posted here and there, nagging others and such over the past 10 weeks or so. I’ve even missed the 9 millionth SL account somewhere along the line. But despite my silence in this space, it’s not like I’ve been sitting on my spherical posterior!

In August I brought together a few bits of technology, tested out a Vista-based budget PC with a little ATI Radeon X1500 upgrade to its graphics. Lo! and behold, somehow the SL viewer worked OK under Vista. Annoyingly, the MS OS trolls rated the native ATI driver at a lower “Windows Experience” rating than the default MS graphics card driver. But the Pentium Duo box was fairly stomping for around $550 with the upgrade. Later in the month (OK, maybe a couple of days later) I wedged the box into luggage and got it set up about 10 zones easterly of SL time.

The cool part was being set up in a medium-sized eastern European city, with cable modem, trucking around SL and having perfectly nominal voice conversations with known avatars. I may have been many thousands of RL miles displaced from home, but I had to say so to have anyone notice. In fact, they were probably a bit skeptical about my claims (like many people might be the first time they get an overseas Skype call.) Try as I might, there wasn’t any difference in the experience that I could tell between using voice-enabled SL in the SF Bay area, and using it in Romania. SL might eventually turn out to be a pleasant supplement to webcam conversations.

Technology-wise I’ve also gained a bunch of media knowledge in these quiet weeks. Thanks to the good folks at Berkeley Community Media, I copped 24 hours of training in field production and Apple Final Cut Pro; for someone like me who has almost enough undergrad and graduate Documentary Film Studies classes to get a minor, it is wonderfully refreshing to see non-linear editing in action. Sure, I’ve got a copy of Adobe Premiere Elements in the home lab running on a PIII/800 Coppermine, and I keep a Pentium D running XP Media Center edition to get some DV capture action happening. But compared to a Dual-Xeon 3 GHz G5 Mac with 4 GB of memory and Final Cut Pro, it’s kids’ stuff that I have at home.

Add some FRAPS action and the SL script Filming Path (from Geuis Dassin and Nand Nerd), and I feel equipped to exploit the Berkurodam build as a sound stage. Now if only I had talent to match my technology…

I did set up a burning car crash in Berkurodam and then neglected to clean it up for several days. Apparently some of my neighbors were displeased, or a strolling Linden took exception to the air pollution that was released by the fire, and (embarrassingly) the mess was cleaned up by them and returned to me. After that, I’m determined that any carnage left on the Berkurodam set will be cleaned up shortly after filming.

Also, in another mainland area, I’ve built a machinima studio of moderately grand proportions, and had some dialog with not-so-near neighbors who suggested ways of lowering my albedo, particularly at night. With very little effort, I blissfully got with the Goth program and have had some fun. Now the studio is a one-acre tower with a shroud of darkness on the outside, and chroma key blue glowing on the inside.

Again this semester, I’m very glad to say that there is a student group has been willing to set up a term project in Second Life. There’s no more space in Gualala, but there should be plenty in the machinima studio for the time being. I look forward to their construction!

Finally, before I fade into RL dreamland, I want to echo my appreciation for Orange Montagne’s book Metaverse Manifesto that I read over the Summer. It’s great! While I haven’t heard from Mr. O directly, I was pleased to post a review of the book on Amazon where I got my copy and recognized today that he’s read the review.

No responses yet