Tuesday, September 18, 2007

Digital Terrain Elevation Data



Today I was determined to figure out how to take real wold terrain data and use it to generate terrains in L3DT. It's not simple but with enough research/digging you can find out how to do it. Here I'll post a very simplified step by step on how to accomplish this.

First, decide what real world terrain you would like to generate, for this exercise I have decided on Fiji, an island in the South Pacific.

Secondly, you need to find the terrain data files which you can get on GeoCommunity. You'll need to sign up for an account but its free and having an account gives you access to the downloads you need. It took me a while to find exactly what I needed but here's your instant access.

I've found that most of the South Pacific island files are of the DTED (Digital Terrain Elevation Data) type, which is fine because the program we are going to use to generate the BT file will accept these as imports. Download your set of terrain DTED files and extract them to a location on your hard drive.

In order to complete the third step you will need to download and install VTBuilder. Once installed run the VTBuilder app and import your DTED files, multiple files can be selected and imported bulk. A little secret, use the Layer -> Import Data command to accomplish the import. As you import the files, VTBuilder will generate a map on the right side of the app window. Select the area which you would like to build a terrain for by using the Area Tool in the menu bar. Draw a box around the area using the tool. After it is selected, choose the Merge & Resample Elevation command from the Area Tool menu. Choose a path to save to and click Save. Later you will find yourself coming back to this window to fiddle with the map size controls for the best results, in the meantime just accept the defaults. This has effectively exported the file to the BT format.




The fourth step involves importing the file into L3DT as a Heightfield. Choose Import -> Heightfield from the File menu of L3DT, then choose the BT file you created in step 3. This loads the heightfield into L3DT. Now you can generate the water map etc. Have Fun!
This is actually a finished map of one of the Solomon Islands.


Friday, September 14, 2007

Large 3D Terrain

There's a free software program out there called L3DT that you can use to generate terrain maps, and this thing rocks my virtual world. The terrain maps can be exported to a raw file format and then loaded into OpenSim. The screen shot at left was taken from within the L3DT viewer, which actually lets you fly around the terrain map once it is rendered.


In OpenSim, I have now created 9 regions, or sims, that form a 3x3 configuration. Using L3DT I can generate a map that covers all 9 sims. With some trial and error, about 8 hours worth, I am now able to generate a map in L3DT and load it into OpenSim without any difficulty. I did notice however that when I try to load a terrain map while I am in world with a friend, I lose all internet connectivity. When I load the terrain map while I am in world, alone, it works fine. I'm thinking this may have something to do with my internet connection and less to do with OpenSim.


The best place to get started making maps is here. This tutorial will take you through the basic steps of creating a map from scratch, which if you are a creative type, is loads of fun. L3DT also gives you the ability to randomly generate maps too if you're in a hurry and you don't care what the map looks like.

In my case, I am creating a map that should cover a 3 sim by 3 sim area, so, thanks to nebadon and the folks on the OpenSim IRC channel, I found out that this configuration requires a 12x12 map, which can be configured when you create the new map in L3DT.

When you create your map in L3DT, it is tempting to go nuts with the mountains, which I did. But unfortunately when the map is loaded into OpenSim, the mountains are severe, so try experimenting with this and use a lower altitude setting than you might at first consider. When exporting the map, go to File: Export Map. Choose the Heightfield map, this is all you need to export. Set the file type to RAW, click the Options button and change the last setting in the list (can't remember the name of it) to float(metres). This is important - you'll get a blob if you don't or it just won't work at all. Name the file and save it.

From within OpenSim's server console, type the command: terrain load-tile f32 myfile.raw 768 768 1000 1000

Make sure the raw file is located in your bin directory otherwise OpenSim can't see it.

If you are in world and doing this, make sure you fly well above the terrain, otherwise if you are in the way of a mountain, it will just swallow you up and you will have to regenerate. After you have executed the first command, execute: terrain multiply .2 You can play around with this setting but generally .2 has been working well for me. The range of values should be something like .1 to .4

I'm pretty sure a tutorial walk through will be up at some point on http://www.opensimulator.org/ but I thought I would share with you what I know in the meantime.

Here are some of pictures of one of my terrains once loaded into OpenSim.















Wednesday, September 12, 2007

First Terrain Success



I have been playing around with OpenSim for a day now and have been able to run the simulator locally with success - thanks to some of the kind people hanging out on the #OpenSim IRC channel. I was also able to create a couple of accounts, invite a couple friends onto the simulator and have some fun.

I started out with Revision 1880 - which I am told there are new builds almost every day, sometimes more than one in a day. The picture to the left is a snapshot of my very first successful terrain upload. Tonught I am going to experiment some more with the terrain tool l3dt and try to set up a grid with multiple regions.