From here on the west coast of the USA, the world has seemed a bit tumultuous in the past four weeks. In a more compact and local way, this has been a time of review and reflection for me. This week I drafted an article for a local GIS Journal to review some of the explorations I’ve made since 2006 of how to create a civic-scale Mirror World. The deadline for the article has motivated me toward a bit more recapitulation on this topic than I’d expected.
My interest in the topic was first kicked off by media attention given to Linden Lab around the registration of the one-millionth resident for Second Life. I checked it out, made a rapid getaway from Orientation Island in around 30 minutes, and within a week or so the broad outlines of some intersections between GIS data and Multi-User Virtual Environments (MUVE) were taking shape in my thoughts. By Summer 2007, I’d made a fairly complex build on the mainland of the Berkeley BART station, and realized how hard it would be to justify the tier for 500 regions to host, much less build out, the entire city. But by October, I’d learned how OpenSim would solve the issue of tier, if only it were possible to make a build efficiently.
Then meshes arrived in the form of sculptie prims, and when an opportunity arose to collaborate with IBM on a multi-region terrain, I devised a way to drape orthoimagery over the region terrain. This Summer 2008 I was able to do that with LiDAR data that draped orthoimagery over terrain, buildings, and trees. The past year has been very much focused on OpenSim for me with this activity.
But behind the week-to-week excitement of OpenSim growth, and even before that, there has been a steady stream of good new stuff from Linden Lab–a stream that I haven’t reflected on so much. First off, the confluence of LibSL’s stabilization by the end of 2006, the open sourcing of the Second Life client in early 2007, and the initiation of OpenSim shortly afterward, together made possible the environment that I’m, if not taking for granted, really expecting to be there for awhile. Meanwhile, back in Second Life, there’s been integration of VoIP, new HAVOK physics, way cool Windlight enhancements to the SL client, a growth in land area that just keeps on going, plus new Openspace regions.
For reasons unrelated to my journal-article recapitulation, today I enjoyed a pleasant visit with a Linden person. It was more time to chat about civic Mirror World applications with a Linden than I’d ever had before, either in-world or real-world. In the course of our conversation, seeing the eyes of someone who is among those directly and personally impacted by OpenSim in the sense of unrealized revenue growth for Linden Lab, I gained an awareness of what is perhaps the largest contribution of Linden Lab to the OpenSim community. That would be Linden forbearance.
It’s growing late this evening for me to write much more on this right now. And as I noted, this feels like a tumultuous time for the world as viewed from west-coast USA, so I need my rest for what might be a tough week ahead. But I’ve felt a shift in perspective today, and wonder anew what the future of an operational civic Mirror World will really look like.
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 http://www.youtube.com/v/EfBvEtTvLYU
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 seamless.usgs.gov 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 Imgine 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.
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