annabunches.net/content/posts/2009-09-08-tutorial-creating-opensim-terrain-with.md

21 lines
8.6 KiB
Markdown
Raw Permalink Normal View History

2016-04-11 22:01:00 +00:00
---
2020-05-15 21:15:51 +00:00
deprecated: true
2016-05-04 18:41:25 +00:00
excerpt_separator: <br/>
category: technology
2016-04-11 22:01:00 +00:00
layout: post
title: 'Tutorial: Creating OpenSim terrain with Blender'
date: '2009-09-08T17:18:00.000-04:00'
author: Anna Wiggins
tags:
- tutorial
- opensim
- second life
- linux
- metaverse
- Technology
modified_time: '2013-10-22T11:19:50.728-04:00'
blogger_id: tag:blogger.com,1999:blog-4209116010564764361.post-5832678214939499715
blogger_orig_url: http://www.stringofbits.net/2009/09/tutorial-creating-opensim-terrain-with.html
---
This tutorial will explain how to create RAW terrain files for <a href="http://opensimulator.org/wiki/Main_Page">OpenSim</a> and <a href="http://secondlife.com">Second Life</a> using <a href="http://blender.org">Blender</a> and the <a href="http://www.gimp.org/">Gimp</a>.<br/><a name='more'></a><br/><h3>Before we begin</h3><br/>You will need the following software for this tutorial. All of this software is free and open source.<br/><ul><br/> <li><a href="http://blender.org">Blender</a>, a professional 3d modelling tool. Blender is powerful but complex, and basic blender knowledge is assumed for this tutorial. Blender will be used to actually create the heightmap.</li><br/> <li><a href="http://www.gimp.org/">The Gimp</a>, a powerful program for creating and editing raster (i.e. normal) image files. The Gimp will be used for splitting the heightmap into RAW terrain files that OpenSim can use.</li><br/> <li><a href="http://dominodesigns.info/project/gimpterrain">gimpterrain</a>, a plug-in for The Gimp that allows it to open and save RAW terrain files.</li><br/> <li><a href="https://github.com/annabunches/terrainerizer">terrainerizer</a> (optional), a bash script I created to automate splitting the heightmap into RAW files. Terrainerizer only works on Linux, and still requires The Gimp and gimpterrain to be installed. It also requires <a href="http://www.imagemagick.org/script/index.php">ImageMagick</a>.</li><br/></ul><br/>In addition to the above software, you will also need a blank RAW terrain file. You could download a terrain file from OpenSim and transform it into a blank one (replace the Height layer with #ffffff, replace the factor layer with #808080), or you could just use the one I've included with terrainerizer.<br/><br/><h3>Create a heightmap</h3><br/>A good tutorial on creating a generic heightmap in Blender can be found <a href="http://wiki.blender.org/index.php/Doc:Tutorials/Textures/Maps/Creating_a_Heightmap_from_a_Plane">here</a>.<br/><br/>The tutorial above creates a heightmap that is 512x512 pixels. However, an OpenSim RAW terrain file is only 256x256 pixels. This means that the above tutorial will create terrain for 4 regions, arranged in a square. If you need terrain for a different number of regions, you can modify the above tutorial to create different sized heightmaps.<br/><br/>For example, suppose you want to create an oblong island that is 2 regions by 4 regions in size. To do that:<br/><br/>1. Create the plane, but instead of scaling it to 2x2 blender units, scale it to 2x4 blender units. To do this, you can use this command sequence in blender:<br/><ul><br/> <li>Right-click on the object to select it.</li><br/> <li>Change the mode to Edit mode.</li><br/> <li>Press 's', 'y', '2', 'return'.</li><br/> <li>Press 's', 'x', '4', 'return'.</li><br/></ul><br/>Now you should have a plane that is oblong instead of perfectly square.<br/><br/>2. When you configure the render settings, you will need to use different values.<br/><ul><br/> <li>In the Scene settings (F10), SizeX and SizeY should be set to 256 * (number of regions). In our case, we have 2 regions in the Y dimension, and 4 regions in the X dimension. So, SizeX should be set to 1024, and SizeY should be set to 512.</li><br/> <li>In the camera settings, the scale needs to be adjusted to fit the plane precisely. In our example, the scale should be set to 8. To get it just right, select the camera, and press Numpad0 to switch to camera view. You should see two concentric rectangles composed of dashed lines. Now, press F9 to view the Editing options for the camera. Now, adjust the Scale value until the outer dashed rectangle encompasses your plane completely, without including anything outside the plane. If the dashed rectangle is not the same shape as your plane, then you still need to set SizeX and SizeY in the Render settings.</li><br/></ul><br/><br/><br/><h3>Creating RAW terrain files with the Gimp</h3><br/>Now that you have a heightmap file, you still need to turn it into terrain files that can be uploaded into OpenSim.<br/><br/