Background
OpenSimulator is the open source version of SecondLife (SL), a virtual world in which avatars can explore, interact with other avatars, build objects, buildings and vehicles, and own and alter land. The basic unit of land in both is the Region, also known as a Sim, and the complete collection of sims for each independent world is called a Grid. In SL, sims are always 256x256m in size. In OS the default size is also 256x256m, by they can also be squares in sizes that are multiples of 256 (e.g. 512x512, 768x768, etc). Below shows a segment of the 3rd Rock Grid map, centred around the welcome centre. Each sim in 3RG is 256x256m in size.
![Image](http://i1158.photobucket.com/albums/p612/laura_ess1/2016-03-253RG_zpscb7ug34e.jpg)
Each sim has a name and a rating. The circle and highlighted area in the above image shows the location of my avatar and what I can see from my avatar's view point when not looking at the map. Now while it's possible to edit the terrain within the virtual world via your avatar, this is a hit and miss operation compared to importing a heightfield created by a dedicated program. In both OS and SL if you're the owner of a sim you can import and expert a heightfield directly into a sim your avatar is in. The Region Estate Dialog Box looks like this (taken sing Singularity viewer in a test grid in a 256x256m sim):
![Image](http://i1158.photobucket.com/albums/p612/laura_ess1/2016-03-25%20Viewer%20Dialog_zpsuu2sgmhl.jpg)
The RAW terrain files are actually Raw BGR (Interleaved) format (and I'd ignore the advice about the "red channel" shown here). According to the SL wiki, each RAW file is: 256 x 256 pixels, 13 channels, Interleaved, 8 bit depth, No header. These are image files (and probably have the same limitations as png images) and you can edit them in Photoshop, but it seems you can't import them directly into LT3D. But this means that even if you don't own/run the grid, you can still save/load terrain directly into your sims, a good thing for SL users because Linden Labs runs that world! Currently, trying to load RAW files saved by LT3D into OS will either give you an error message or incredible spikey terrain as OS fails to interpret it.
The other way of getting terrain into and out of sim is via the console. The console isn't available directly to users of SL, but if you run an OS grid you have access to it. The commands used are:
- Code: Select all
change region <region name>
terrain save "<filename>"
terrain load "<filename>"
terrain save-tile "<filename>" tilewidth tileheight xMin yMin
terrain load-tile "<filename>" tilewidth tileheight xMin yMin
In general you need to change to a region before you do terrain save or terrain load to it. The console starts at the root location and any command made there affect ALL regions (and you can always go back to that using change region root). The console interprets a <space> as a divider unless it's withing quotes, which is why I have them around <file name>. The tilewidth and tileheight are measured in sims, and the xMin and yMin are the grid's coordinates of the bottom left corner of the rectangle of sims defined by tilewidth and tileheight. For example, the command for importing terrain for a 2 wide by 3 high grid of sims might look like this...
terrain load-tile "\\MEDIA-WIN7\OS-SL\Seconds\Urbania\LT3D\r32Files\South Island Test.r32" 2 3 1020 945
...where 1020,945 is the location of the bottom left corner of the 2x3 rectangle of sims. Doing a simple save or load of the terrain can only be in png and .r32 formats. At the moment OS can only save-tile to png format, but it can load-tile from .r32 (RAW32), .f32 (RAW32), .ter (Terragen), .raw (LL/SL RAW), .jpg (JPEG), .jpeg (JPEG), .bmp (BMP), .png (PNG), .gif (GIF), .tif (TIFF), .tiff (TIFF), .gsd (SYS.DRAWING) formats.
Having a mosaic-tiled project in LT3D seems like a good idea for someone using LT3D to make their terrains for OS. The tiles can easily be used to correspond to ones in their OS Grid in layout and size. Selections that match tiles or larger groups can be imported and exported either way in r32 format. Selecting the Split Map into Tiles (Mosiac Map) option in the Export Map wizard will (if you set it up correctly) export heightfield files in r32 format so that there's an r32 file for each region in your OS Grid.
I'll make my suggestions about enhancing this in the next reply to this post (just taking a break for lunch).