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 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.

No comments: