Heightmap Files
5 nodes
On this page 5
Export Obj
FunctionExports the heightmap to an OBJ 3D file.
ExportObj
heightmap: Scalar Field
filePath: Text
useQuads: Truth
includeNormals: Truth
includeTextureCoords: Truth
vertexMode: Truthvoid ExportObj(
ScalarField2D heightmap,
string filePath,
bool useQuads = false,
bool includeNormals = false,
bool includeTextureCoords = false,
bool vertexMode = false)Parameters
| name | type | default | description |
|---|---|---|---|
| heightmap | Scalar Field | — | |
| filePath | Text | — | The path to the OBJ file to be created. |
| useQuads | Truth | False | If true, exports using quads; otherwise, uses triangles. |
| includeNormals | Truth | False | |
| includeTextureCoords | Truth | False | |
| vertexMode | Truth | False | If true, consider each vertex in the data array as center of each pixel, we need to create new vertices based on the center. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Files
- Package
- Procedural Generation
Load Heightmap
FunctionA heightmap from a file, in metres: a GeoTIFF elevation raster with its cell size, a 16-bit or 8-bit image, or a raw 16-bit grid (.r16, .raw) as engines write them.
LoadHeightmap -> Scalar Field
path: Text
cellSizeMetres: Number
lowestMetres: Number
highestMetres: NumberScalarField2D LoadHeightmap(
string path,
double cellSizeMetres = 0,
double lowestMetres = 0,
double highestMetres = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The file. |
| cellSizeMetres | Number | 0 | Ground metres one cell covers. A GeoTIFF says this itself and 0 takes its word; an image or raw grid needs it, and is laid at a metre a cell when it is 0. |
| lowestMetres | Number | 0 | For an image or raw grid, the elevation its darkest value stands for. A TIFF's values are already metres. |
| highestMetres | Number | 0 | For an image or raw grid, the elevation its brightest value stands for; no higher than the lowest leaves its values 0..1. |
Returns
| Heightmap | Scalar Field |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Files
- Package
- Procedural Generation
Save As Obj Mesh
FunctionSave the terrrain into .obj 3D grid mesh format.
SaveAsObjMesh
terrain: Scalar Field
outputPath: Text
optimized: Truthvoid SaveAsObjMesh(
ScalarField2D terrain,
string outputPath,
bool optimized = false)Parameters
| name | type | default | description |
|---|---|---|---|
| terrain | Scalar Field | — | |
| outputPath | Text | — | |
| optimized | Truth | False |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Files
- Package
- Procedural Generation
Save Heightmap
FunctionSaves a heightmap. A .tif keeps its metres and its cell size, readable by GDAL, QGIS, World Machine and Gaea: with a precision, as 16-bit steps of that size, half the size of 32-bit floats; with none, as 32-bit floats. A .png is a 16-bit grey image and a .r16 a raw 16-bit grid, as game engines import terrain, each stretched over the heightmap's own range, which the node's result reports.
SaveHeightmap -> Text
heightmap: Scalar Field
path: Text
precisionMetres: Numberstring SaveHeightmap(
ScalarField2D heightmap,
string path,
double precisionMetres = 0.01)Parameters
| name | type | default | description |
|---|---|---|---|
| heightmap | Scalar Field | — | Heights in metres. |
| path | Text | — | Where to save it: .tif, .png or .r16. |
| precisionMetres | Number | 0.01 | For a .tif, the step heights are stored to, metres: 0.01 keeps them to a centimetre. 0 stores 32-bit floats. |
Returns
| Saved | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Files
- Package
- Procedural Generation
Set Cell Size
FunctionThe same heights laid over more or less ground: a generated heightmap, which knows nothing of metres, given the size it is meant to be. A 1024-cell terrain at 2 metres a cell is two kilometres across; every texturing, erosion and water node reads this.
SetCellSize -> Scalar Field
heightmap: Scalar Field
cellSizeMetres: NumberScalarField2D SetCellSize(
ScalarField2D heightmap,
double cellSizeMetres = 2)Parameters
| name | type | default | description |
|---|---|---|---|
| heightmap | Scalar Field | — | Heights in metres. |
| cellSizeMetres | Number | 2 | Ground metres one cell covers. |
Returns
| Heightmap | Scalar Field |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Files
- Package
- Procedural Generation