Motion SDK

Geometry

Ten procedural shapes, plus glTF models, drawn with a material.

A mesh is a geometry and a material. Geometries are single-key variants: {"sphere": {"radius": 1}}.

Every built-in geometry, in clay.
{
  "camera": { "position": [0, 0, 10], "target": [0, 0, 0], "fov": 40 },
  "lighting": { "rig": "three_point" },
  "environment": {
    "background": {
      "radial_gradient": { "inner": "#1b2233", "outer": "#07090f" }
    }
  },
  "materials": { "clay": { "preset": "matte_clay", "color": "#d9d4cc" } },
  "nodes": {
    "box": {
      "transform": { "position": [-3.8, 1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "box": { "size": [1, 1, 1] } },
        "material": "clay"
      }
    },
    "rounded_box": {
      "transform": { "position": [-1.9, 1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "rounded_box": { "size": [1, 1, 1], "radius": 0.2 } },
        "material": "clay"
      }
    },
    "sphere": {
      "transform": { "position": [0, 1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "sphere": { "radius": 0.6 } },
        "material": "clay"
      }
    },
    "cylinder": {
      "transform": { "position": [1.9, 1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "cylinder": { "radius": 0.5, "height": 1.1 } },
        "material": "clay"
      }
    },
    "cone": {
      "transform": { "position": [3.8, 1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "cone": { "radius": 0.5, "height": 1.1 } },
        "material": "clay"
      }
    },
    "capsule": {
      "transform": { "position": [-3.8, -1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "capsule": { "radius": 0.35, "length": 0.6 } },
        "material": "clay"
      }
    },
    "torus": {
      "transform": { "position": [-1.9, -1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "torus": { "radius": 0.5, "tube": 0.18 } },
        "material": "clay"
      }
    },
    "torus_knot": {
      "transform": { "position": [0, -1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "torus_knot": { "radius": 0.45, "tube": 0.15 } },
        "material": "clay"
      }
    },
    "icosahedron": {
      "transform": { "position": [1.9, -1, 0], "rotation": [20, 30, 0] },
      "mesh": {
        "geometry": { "icosahedron": { "radius": 0.6 } },
        "material": "clay"
      }
    },
    "plane": {
      "transform": { "position": [3.8, -1, 0], "rotation": [70, 0, 0] },
      "mesh": {
        "geometry": { "plane": { "size": [1.6, 1.6] } },
        "material": "clay"
      }
    }
  }
}
Every built-in geometry, in clay. apps/docs/examples/geometry.json · render it with motion-sdk render apps/docs/examples/geometry.json -t 1 -o geometry.png

Shapes

box, rounded_box, sphere, plane, cylinder, cone, capsule, torus, torus_knot and icosahedron. Every size has a default, so {"sphere": {}} works. Cylinders, cones, capsules and spheres stand along +y. A plane faces +z: rotate it [-90, 0, 0] to make a floor.

For imported meshes use {"model": {...}}; see Models. For a heightfield use {"terrain": {...}}; see Terrain.

Tips

  • For thousands of thin copies, like stems or posts, give cylinders and cones "segments": 5 to 8.
  • Geometry that differs per copy, like a different cylinder height, can't be instanced. Scale a unit mesh instead.
  • cast_shadows and receive_shadows are on by default. Turn them off for sky domes, glows and distant scenery.

API Reference

Mesh

A primitive mesh with a material.

PropertyTypeDefaultDescription
cast_shadowsbooleantrueWhether the mesh casts shadows.
geometry*GeometryrequiredThe shape: a procedural geometry or a glTF model.
instancesInstances—Draw many copies with a single instanced draw call.
materialstring—Name of an entry in materials, or "preset:<name>" (e.g. "preset:chrome"). Omit for the default material.
receive_shadowsbooleantrueWhether shadows fall on the mesh.
skinSkin—Bend the mesh with a procedural rig: other nodes act as bones.

Geometry

Built-in procedural geometry. Written as {"sphere": {"radius": 1}}.

{"box": { … }}A box.

PropertyTypeDefaultDescription
size[x, y, z][1,1,1]Full size [x, y, z].

{"rounded_box": { … }}A box with rounded edges.

PropertyTypeDefaultDescription
radiusnumber0.1Edge radius.
size[x, y, z][1,1,1]Full size [x, y, z].

{"sphere": { … }}A UV sphere.

PropertyTypeDefaultDescription
radiusnumber1Radius.
segmentsinteger48Segments around the equator. More is smoother.

{"plane": { … }}A flat rectangle facing +z. Rotate it [-90, 0, 0] to lay it flat as a floor or water.

PropertyTypeDefaultDescription
size[x, y][1,1]Size [width, height].

{"cylinder": { … }}A capped cylinder along y.

PropertyTypeDefaultDescription
heightnumber1Height along y.
radiusnumber0.5Radius.
segmentsinteger—Sides around the axis (3..=64). Use 5-8 for thin stems and scattered copies: far fewer triangles.

{"cone": { … }}A cone along y.

PropertyTypeDefaultDescription
heightnumber1Height along y.
radiusnumber0.5Base radius.
segmentsinteger—Sides around the axis (3..=64). Use 5-8 for thin stems and scattered copies: far fewer triangles.

{"capsule": { … }}A cylinder with hemispherical ends, along y.

PropertyTypeDefaultDescription
lengthnumber1Length of the straight middle part.
radiusnumber0.25Radius.

{"torus": { … }}A ring.

PropertyTypeDefaultDescription
radiusnumber1Distance from the centre to the middle of the tube.
tubenumber0.3Tube radius.

{"torus_knot": { … }}A (p, q) torus knot.

PropertyTypeDefaultDescription
pinteger2Times the knot winds around its axis.
qinteger3Times the knot winds through the hole.
radiusnumber1Overall radius.
tubenumber0.3Tube radius.

{"icosahedron": { … }}A 20-sided solid. Good for low-poly rocks.

PropertyTypeDefaultDescription
detailinteger0Subdivision level, 0 = faceted.
radiusnumber1Radius.

{"terrain": Terrain}Seeded noise heightfield on the XZ plane: rolling ground, or ridged mountains with "ridged": true. Scatter rocks on it with the on_terrain instance layout.

{"shape": Shape}A flat 2D vector shape in the XY plane (rect, circle, ellipse, polygon or Bézier; filled, or stroked with stroke). Authoring builds only (the browser loads the authoring bundle for it).

{"model": Model}A glTF 2.0 model (.glb, or .gltf with embedded buffers). Nothing draws until it loads.