Part 6: Terrain Support

Terrain fields are used by the OpenSim Region host (or any other online worldhost) to define the surface of the hosted Island (Terrain). A Terrain field is made out of a plane with 256*256 vertices. Where the z-value of each vertex defines the actual terrain height at the corresponding <x,y> location of the vertex.

Back to Multi Part Exporter

Primstar-2 can import and export SL Terrain fields.

Import (from Terrain File)

Import an SL compatible Terrain from File. The file must contain a valid Terrain as defined in the Data structure above.

File -> Import -> SL Terrain (.raw)

Since we use 1 blender unit for one meter, the SL Terrain will be imported as a huge Object of size 255*255 Blender Units. You can scale the file down after import if you like.

Some virual world providers offer ready made Terrain files which can be used as starting point for any Terrain work.

Import (from Image)

Import an SL compatible Terrain from a height map

UV Image editor: Image -> Import as Terrain

The image must be a gray scale RGB image of size 256*256 pixels. Each pixel corresponds to one vertex in the Terrain field.

Since we use 1 blender unit for one meter, the SL Terrain will be generated as a huge Object of size 255*255 Blender Units. You can scale the file down after import if you like.

Export ( as Terrain file)

Export an Object as SL Terrain. Almost any object can be exported as Terrain.

File ->Export -> SL Terrain (.raw)

  • Constant Factor:
    If this checkmark is disabled:
    Adjust the factor for each point in the terrain field individually, such that the optimal resolution is used in the entire height field. Note: We found that when we optimize the 2nd channel data, we get offsets from the expected terrain height and we get much rougher terrain. Hence this setting is considered as highly experimental.
    If the checkmark is enabled (default, also recommended):
    Use the value of Factor for scaling. Factor is in the range [0-255] where 0 means: scale to zero, while 255 means scale to double height. This allows Terrains of maxheight 512 Meters.

Detailed description: 

The exporter uses a projection view (top view, orthogonal) and determines for each location the highest vertex within the object bounding box. If it can not find any vertex by following a projection line, the corresponding height value is set to zero. The resulting height field is scaled and interpolated to a 255*255 sqm wide SL compatible Terrain field.

the z scale is calculated from the z-distance between the object’s origin and the highest vertex. Any vertex in the field which lies below the object origin is automatically lifted up to the objects origin height.

This mapping works for any Mesh Object.

Hint: If your Terrain object uses a Subdivision modifier, ensure that the borders of your Object get creased to 1.0 Otherwise you may get wrong mapping at the borders.

Examples

Using ANT to create a Terrain field:

Creating a sculptie array from a Terrain field:

2 Enlightened Replies

Trackback  •  Comments RSS

  1. Shy Robbiani says:

    Yes, in my opinion this is correct. Take a closer look and you will see that all is a matter of the terrains huge size.

    Think about the cursor as the ZERO VECTOR of your region, the point at 0 m in the South/West corner of the region.

    The lowest point in my terrains f.eks. is usually between 7 and 12 m below the sea level (which defaults to 20 m) and therefore my terrain will usually be between 8 and 13 m above the cursor.

  2. krakatoa says:

    When I import a SL terrain file (well is an opensim terrain file) I find the terrain object is floating way above my cursor and default grid (see picture). Is this normal? I tried to ‘snap to cursor’ but the terrain won’t move. I am using Blender 2.62.

    [img]http://blog.machinimatrix.org/wp-content/uploads/2012/04/terrain.PNG[/img]

Post a Reply

Your email address will not be published. Required fields are marked *

Top