Part 6: Terrain Support
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.
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.
Using ANT to create a Terrain field:
Creating a sculptie array from a Terrain field: