Divooka Reference

Heights

4 nodes

On this page 4

Composite Heights

Function

The world's terrain as its visible layers make it: each cell's height from the topmost layer painted there, or the deepest level where none is.

Signature
CompositeHeights(world: World) -> Scalar Field
ScalarField2D CompositeHeights(World world)

Parameters

nametypedefaultdescription
worldWorld—The world.

Returns

HeightsScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Heights
Package
Fantasy Planet Painter

Heights From Image File

Function

A heightfield from a height image: a greyscale PNG, 8 or 16 bits, whose black is the lowest height and white the highest.

Signature
HeightsFromImageFile -> Scalar Field
    path: Text
    lowest: Number
    highest: Number
    width: Integer
    height: Integer
ScalarField2D HeightsFromImageFile(
    string path,
    double lowest = -4000,
    double highest = 6000,
    int width = 0,
    int height = 0)

Parameters

nametypedefaultdescription
pathText—The image file.
lowestNumber-4000The height black stands for, in metres.
highestNumber6000The height white stands for, in metres.
widthInteger0Columns of the field; 0 keeps the image's.
heightInteger0Rows of the field; 0 keeps the image's.

Returns

HeightsScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Heights
Package
Fantasy Planet Painter

Layer Heights

Function

One layer's heights, in metres on the datum, each cell's exact height or its level's.

Signature
LayerHeights(world: World, layer: Integer) -> Scalar Field
ScalarField2D LayerHeights(World world, int layer = 0)

Parameters

nametypedefaultdescription
worldWorld—The world.
layerInteger0Which layer, from the bottom at 0.

Returns

HeightsScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Heights
Package
Fantasy Planet Painter

Set Layer Heights

Function

The world with one layer's heights replaced by a heightfield: each value becomes that cell's exact height, and a value that is not a number empties its cell.

Signature
SetLayerHeights -> World
    world: World
    heights: Scalar Field
    layer: Integer
World SetLayerHeights(
    World world,
    ScalarField2D heights,
    int layer = 0)

Parameters

nametypedefaultdescription
worldWorld—The world.
heightsScalar Field—Heights in metres on the datum, row by row from the north.
layerInteger0Which layer, from the bottom at 0.

Returns

WorldWorld

Remarks

A field of another size resizes the whole world's grid to it, at most 2,048 cells each way.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Heights
Package
Fantasy Planet Painter