Namespace: shf3d

shf3d

Module ID: shellfish/3d

This module provides 3D elements for use with Shellfish to render scenes in 3D.

The View element is used to render a scene.

shf3d.View {
    ambience: rgb(1.0, 1.0, 1.0)

    scene: shf3d.Group {
        shf3d.Camera {
            location: vec3(0, 0, 5)
        }
        shf3d.Cube {
            rotationAxis: vec3(1, 1, 0)
            rotationAngle: 30
            material: shf3d.Material { color: colorName("red") }
        }
    }
}

The scene is represented by a scene entity. The Group scene entity is used to group several scene entities together to be treated as one. This way, scenes of arbitrary complexity may be composed.

Since the camera is a scene entity itself, it may be moved through the scene, for example, as member of a moving Group.

The View can switch between multiple cameras in a scene.

Classes

Camera
Clone
Collider
Cube
Entity
Group
HeightMesh
Light
Material
Mesh
Model3D
Sphere
SubView
Surface
View

Methods

shf3d.Entity#vec3 (x, y, z)vec3 static overrides

Creates a 3-component vector.

Name Type Description
x number

The X component.

y number

The Y component.

z number

The Z component.

Returns:
Type Description
vec3 The vector.