TerrainMesh
TerrainMesh is a console tool for creating height maps from the meshes or directly from OBJ files.
To invoke TerrainMesh, run terrainmesh_x86.exe (in Windows) or terrainmesh_x86 (in Linux) from a command-line console (the 64-bit version has x64 postfix).
Command Line Options
TerrainMesh recognizes the following command line options:
- -o NAME — name of the output file.
- -s SIZE — size of the output image (width equals height). The default is 1025x1025.
- -w WIDTH — width of the output image. The default is 1025.
- -h HEIGHT — height of the output image. The default is 1025.
Input and Output Formats
All mesh formats that can be converted into Unigine meshes are supported. A list of such formats is available here: Supported File Formats.
The following output formats are supported:
- Portable Network Graphics (PNG)
- PhotoShop Document (PSD)
- Direct Draw Surface (DDS)
Usage
The syntax for Windows is:
terrain_x86.exe OPTIONS FILE
The syntax for Linux is:
terrain_x86 OPTIONS FILE
Type of an output file is determined based on its extension (see the -o option).
For example, to create a height map from a mesh, use the following:
terrain_x86.exe mesh.obj
Height Map Creation Example
To create a height map out of the 3D mesh in obj format, you need to do the following:
- Open the command-line console. For Windows, click Start→>Run and type cmd. Click OK.
- Now, suppose the following:
- You have a mesh called myterrain.obj located in the folder C:\My Stuff\Raw.
- Your terrain size need to be 1024×1024 cells.
- You want to save a height map into a file C:\My Stuff\Raw\height map.png.
terrainmesh_x86.exe -o "C:\My Stuff\Raw\height map.png" -s 1024 "C:\My Stuff\Raw\myterrain.obj"