Divooka Reference

Scene Rendering

6 nodes

On this page 6

Assign Object Material

Function

Overload 1 of 2

Signature
AssignObjectMaterial -> Preview Geometry
    geometry: N-gon Geometry
    color: Color
    gloss: Number
    glow: Number
PreviewNGonGeometryInstance AssignObjectMaterial(
    NGonFaceIndexMesh geometry,
    ColorElement color,
    double gloss = 0.3,
    double glow = 0)

Makes a mesh an object in a colour that may shine: Gloss catches the lights as highlights, Glow makes it shine of itself.

Parameters

nametypedefaultdescription
geometryN-gon Geometry—The mesh.
colorColor—Its colour.
glossNumber0.3From 0, matte like chalk, to 1, polished like a billiard ball.
glowNumber0From 0, lit only by the lights, to 1, as bright as its colour in the dark.

Returns

ObjectPreview Geometry

Overload 2 of 2

Signature
AssignObjectMaterial -> Preview Geometry
    object: Preview Geometry
    color: Color
    gloss: Number
    glow: Number
PreviewNGonGeometryInstance AssignObjectMaterial(
    PreviewNGonGeometryInstance object,
    ColorElement color,
    double gloss = 0.3,
    double glow = 0)

Gives an object a colour that may shine: Gloss catches the lights as highlights, Glow makes it shine of itself.

Parameters

nametypedefaultdescription
objectPreview Geometry—The object.
colorColor—Its colour.
glossNumber0.3From 0, matte like chalk, to 1, polished like a billiard ball.
glowNumber0From 0, lit only by the lights, to 1, as bright as its colour in the dark.

Returns

ObjectPreview Geometry
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scene Rendering
Package
Procedural Generation

Camera

Function

A camera at a point, looking at another.

Signature
Camera -> Preview Camera
    position: Vector3d
    target: Vector3d
    fieldOfView: Number
PreviewCamera Camera(
    Vector3d position,
    Vector3d target,
    double fieldOfView = 40)

Parameters

nametypedefaultdescription
positionVector3d—Where the camera stands.
targetVector3d—What it looks at, at the middle of the picture.
fieldOfViewNumber40How much of the scene the picture's height takes in, in degrees: about 40 is a normal lens.

Returns

CameraPreview Camera
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scene Rendering
Package
Procedural Generation

Lamp

Function

Light from a point in the scene, weaker the farther it travels: a lamp.

Signature
Lamp -> Preview Light
    position: Vector3d
    color: Color
    intensity: Number
    range: Number
PreviewLight Lamp(
    Vector3d position,
    ColorElement color,
    double intensity = 1,
    double range = 10)

Parameters

nametypedefaultdescription
positionVector3d—Where the lamp is.
colorColor—Its colour.
intensityNumber1How bright it is close by: 1 lights a surface facing it fully.
rangeNumber10The distance at which its light has fallen to half.

Returns

LightPreview Light
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scene Rendering
Package
Procedural Generation

Pose

Function

A model posed at a moment of one of its animations: a skinned model's skin follows its skeleton as the animation has it then, a stick figure mid-stride.

Signature
Pose -> Preview Scene
    model: Native Model
    time: Number
    animation: Text
SimplePreviewScene Pose(
    NativeModel model,
    double time = 0,
    string animation)

Parameters

nametypedefaultdescription
modelNative Model—The model, as Import Animated Model or Get Library Animated Model reads one.
timeNumber0The moment, in seconds; an animation that loops wraps it round, so a time that only grows plays the animation over and over, and one that falls plays it backwards.
animationText—Which of its animations, by name; none for its first.

Returns

ScenePreview Scene

Remarks

Round 26. A model is drawn as the file has it - a glTF's Y up and +Z its front - turned into the preview scene's Z up with its front along +X, so a figure walks along its heading when Place turns it.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scene Rendering
Package
Procedural Generation

Render Scene

Function

A picture of the scene, taken by the camera under the lights.

Signature
RenderScene -> Pixel Image
    scene: Preview Scene
    camera: Preview Camera
    lights: Preview Light Array
    width: Integer
    height: Integer
    sky: Optional Color
    horizon: Optional Color
    smoothEdges: Truth
PixelImage RenderScene(
    SimplePreviewScene scene,
    PreviewCamera camera,
    PreviewLight[] lights,
    int width = 960,
    int height = 540,
    ColorElement? sky,
    ColorElement? horizon,
    bool smoothEdges = true)

Parameters

nametypedefaultdescription
scenePreview Scene—What to render: the objects, in their colours and places.
cameraPreview Camera—Where the picture is taken from.
lightsPreview Light Array—The lights; with none, the sky alone lights the scene.
widthInteger960The picture's width, in pixels.
heightInteger540The picture's height, in pixels.
skyOptional Color—The sky overhead, which also lights what faces up.
horizonOptional Color—The sky at eye level, which distant things fade into.
smoothEdgesTruthTrueWhether edges are smoothed, at four times the work.

Returns

PicturePixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scene Rendering
Package
Procedural Generation

Sun

Function

Light from very far away, the same direction everywhere: the sun.

Signature
Sun -> Preview Light
    direction: Vector3d
    color: Color
    intensity: Number
    castsShadows: Truth
PreviewLight Sun(
    Vector3d direction,
    ColorElement color,
    double intensity = 1,
    bool castsShadows = true)

Parameters

nametypedefaultdescription
directionVector3d—Where the sun is, as a direction from the scene: (0, 0, 1) is straight overhead, (1, 1, 1) high to one side.
colorColor—Its colour.
intensityNumber1How bright it is: 1 lights a surface facing it fully.
castsShadowsTruthTrueWhether what it lights throws shadows.

Returns

LightPreview Light
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scene Rendering
Package
Procedural Generation