3D Element

A 3D element represents three-dimensional objects in your project, including imported 3D models, basic geometry primitives, extruded shapes from 2D shapes, 3D text, and boolean operation results.

3D elements share the common fields from Basic Element and View Element, while also introducing additional 3D-specific properties.

Basic Fields

PropTypeRequiredExampleValue RangeDescription
typestringtrue-3DThe type of the element. For 3D elements, this is always "3D".
sourceIdstringfalse--Internal identifier for the 3D model or geometry resource.
extstringfalse-glb | gltf | fbx | obj | geometry | text3d | parametric | topology | curveThe file extension or node type of the 3D element.
externalUrlstringfalse--Optional URL for loading external glTF/glb models. The engine will fetch and cache the model.
nodeTypestringfalse-geometry | text3d | model | parametric | topology | curveThe type of 3D node. Determines the structure of additional properties.
categorystringfalse-For geometry: basic | polyhedron. For parametric: extrusion | lathe. For topology: boolean | array | mirror | compound. For curve: helix | torusKnot | customSub-category of the 3D node. Available values depend on nodeType.
geometryTypestringfalse--The type of basic geometry. See "Geometry Types" section below.
originalWidthnumberfalse--The original width of the 3D model in world units.
originalHeightnumberfalse--The original height of the 3D model in world units.
originalDepthnumberfalse--The original depth of the 3D model in world units.
animationobjectfalse--Animation settings for glTF models with animations. Contains currentIndex, speed, and loop properties.

3D Transform Fields

In addition to the standard 2D transform properties (x, y, rotation, scaleX, scaleY), 3D elements support additional transform properties for three-dimensional positioning and rotation:

PropTypeRequiredExampleValue RangeDescription
znumberfalse--The depth position of the element in 3D space. Units are aligned with pixels, where z=0 corresponds to the canvas plane.
rotationXnumberfalse--Rotation around the X-axis, in degrees.
rotationYnumberfalse--Rotation around the Y-axis, in degrees.
scaleZnumberfalse-> 0Scaling factor along the Z-axis. Values > 1 enlarge, values between 0 and 1 shrink.

Geometry Types

The geometryType field specifies the type of basic 3D geometry. Available types are organized by category (specified via the category field when nodeType: "geometry"):

Basic Shapes (category: "basic"):

  • cube - Six-sided box
  • sphere - Spherical geometry
  • cylinder - Cylindrical geometry
  • cone - Conical geometry
  • torus - Donut-shaped geometry
  • capsule - Pill-shaped geometry
  • disc - Flat circular disc

Polyhedrons (category: "polyhedron"):

  • pyramid - Four-sided pyramid
  • octahedron - Eight-faced polyhedron
  • icosahedron - Twenty-faced polyhedron
  • dodecahedron - Twelve-faced polyhedron
  • hexPrism - Six-sided prism
  • triangle - Triangular prism

Parametric Node Types

Parametric nodes (nodeType: "parametric") generate geometry procedurally:

Extrusion (category: "extrusion"):

  • Extrudes 2D shapes along the Z-axis with depth and beveling

Lathe (category: "lathe"):

  • Revolves a 2D profile around an axis to create cylindrical objects

Curve Node Types

Curve nodes (nodeType: "curve") create 3D curves and paths:

Helix (category: "helix"):

  • Helical spiral curves with configurable radius and pitch

Torus Knot (category: "torusKnot"):

  • Mathematical knot curves on a torus surface

Custom (category: "custom"):

  • User-defined curve paths

Topology Node Types

Topology nodes (nodeType: "topology") perform operations on existing geometry:

Boolean (category: "boolean"):

  • Union, intersection, or subtraction of multiple 3D objects

Array (category: "array"):

  • Duplicate objects in linear, circular, or grid patterns

Mirror (category: "mirror"):

  • Mirror geometry across X, Y, or Z planes

Compound (category: "compound"):

  • Combine multiple operations in sequence

Shape Extrusion

3D elements can be created by extruding 2D shapes. When you convert a 2D Shape element to 3D in the editor, it generates a new type: "3D" element with the following additional fields:

PropTypeRequiredExampleValue RangeDescription
extrusionSourceobjectfalse--The original 2D shape data used to create the 3D extrusion. Contains the complete ShapeNodeData.
shapeSizeXnumberfalse--Width of the extruded shape, in pixels.
shapeSizeYnumberfalse--Height of the extruded shape, in pixels.
shapeExtrusionnumberfalse--Depth of extrusion along the Z-axis, in pixels.
shapeCornerstringfalse-round | chamfer | straightCorner type for extruded shapes.
shapeRoundnessSmoothnumberfalse-0 - 1Smoothness of rounded corners (0-1).
shapeRoundnessArcnumberfalse--Arc radius for rounded corners.
shapeBevelnumberfalse--Bevel depth for edges.
shapeBevelSidesnumberfalse--Number of segments for beveled edges.

3D Text

3D elements can also represent three-dimensional text with depth and beveling:

PropTypeRequiredExampleValue RangeDescription
textContentstringfalse--The text content to render in 3D.
textStyle3Dobjectfalse--Text styling properties (font, size, weight, etc.). Reuses some 2D text style fields.
textDepthnumberfalse--Extrusion depth of the 3D text.
textBevelSizenumberfalse--Size of the bevel on text edges.
textBevelSegmentsnumberfalse--Number of segments for text beveling.
textCurveSegmentsnumberfalse--Number of segments for text curves.

Materials and Textures

3D elements use a PBR (Physically Based Rendering) material system with comprehensive texture support:

PropTypeRequiredExampleValue RangeDescription
materialobjectfalse--Complete material configuration including PBR properties and texture maps.

The material object contains:

physicalMaterialData - PBR material properties:

  • color (string) - Base color in hex format, default: '#818cf8'
  • roughness (number) - Surface roughness, 0-1, default: 0.4
  • metalness (number) - Metallic property, 0-1, default: 0.0
  • opacity (number) - Material opacity, 0-1, default: 1.0
  • transmission (number) - Light transmission for glass-like materials, 0-1, default: 0.0
  • ior (number) - Index of refraction, typically 1.0-2.5, default: 1.5
  • clearcoat (number) - Clear coating layer intensity, 0-1, default: 0.0
  • clearcoatRoughness (number) - Clear coat roughness, 0-1, default: 0.0
  • sheen (number) - Fabric-like sheen effect, 0-1, default: 0.0
  • sheenRoughness (number) - Sheen roughness, 0-1, default: 0.0
  • sheenColor (string) - Sheen tint color
  • thickness (number) - Material thickness for transmission

materialXPath (string) - Optional MaterialX preset path:

  • Examples: 'StandardSurface/standard_surface_gold.mtlx', 'StandardSurface/standard_surface_brass_tiled.mtlx'
  • When loaded, overrides physicalMaterialData with preset values

Texture Maps - The material object can contain texture map URLs:

  • colorMap - Base color/diffuse texture
  • normalMap - Normal map for surface detail
  • roughnessMap - Roughness texture
  • metalnessMap - Metalness texture
  • aoMap - Ambient occlusion map
  • emissiveMap - Emissive/glow texture

Texture maps are applied using TSL (Three.js Shading Language) functions for optimal performance.

glTF Models and Animations

3D elements with nodeType: "model" represent imported 3D models:

  • Use source.url to specify the URL of the remote glTF/glb/FBX file
  • The engine will fetch and cache the model using sourceId
  • If the model contains animations, use animation.currentIndex to select which animation to play
  • Animation properties: currentIndex (number), speed (number, default 1.0), loop (boolean, default true)
  • Models support DRACO compression for smaller file sizes
  • sizeParams contains width, height, depth for model dimensions

Examples

Basic Cube

cubeElement.json
1 2{ 3 "id": "3d-cube-001", 4 "type": "3D", 5 "start": 0, 6 "duration": 5, 7 "trackIndex": 0, 8 "x": 540, 9 "y": 540, 10 "z": 0, 11 "width": 200, 12 "height": 200, 13 "anchorX": 100, 14 "anchorY": 100, 15 "rotation": 0, 16 "rotationX": 30, 17 "rotationY": 45, 18 "scaleX": 1, 19 "scaleY": 1, 20 "scaleZ": 1, 21 "alpha": 1, 22 "ext": "geometry", 23 "nodeType": "geometry", 24 "category": "basic", 25 "geometryType": "cube", 26 "material": { 27 "physicalMaterialData": { 28 "color": "#4A90E2", 29 "roughness": 0.4, 30 "metalness": 0.0 31 } 32 } 33} 34

Extruded Shape

extrudedShapeElement.json
1 2{ 3 "id": "3d-extrusion-001", 4 "type": "3D", 5 "start": 0, 6 "duration": 5, 7 "trackIndex": 0, 8 "x": 540, 9 "y": 540, 10 "z": 0, 11 "width": 300, 12 "height": 300, 13 "anchorX": 150, 14 "anchorY": 150, 15 "rotation": 0, 16 "rotationX": 0, 17 "rotationY": 0, 18 "scaleX": 1, 19 "scaleY": 1, 20 "scaleZ": 1, 21 "alpha": 1, 22 "ext": "parametric", 23 "nodeType": "parametric", 24 "category": "extrusion", 25 "shapeSizeX": 300, 26 "shapeSizeY": 300, 27 "shapeExtrusion": 100, 28 "material": { 29 "physicalMaterialData": { 30 "color": "#FF6B6B", 31 "roughness": 0.3, 32 "metalness": 0.1 33 } 34 }, 35 "extrusionSource": { 36 "shapeType": "SHAPE_STAR", 37 "starPoints": 5, 38 "starInnerRadius": 0.4 39 } 40} 41

glTF Model with Animation

gltfModelElement.json
1 2{ 3 "id": "3d-model-001", 4 "type": "3D", 5 "start": 0, 6 "duration": 10, 7 "trackIndex": 0, 8 "x": 540, 9 "y": 540, 10 "z": -200, 11 "width": 400, 12 "height": 400, 13 "anchorX": 200, 14 "anchorY": 200, 15 "rotation": 0, 16 "rotationX": 0, 17 "rotationY": 0, 18 "scaleX": 1, 19 "scaleY": 1, 20 "scaleZ": 1, 21 "alpha": 1, 22 "ext": "glb", 23 "nodeType": "model", 24 "sourceId": "cached-model-123", 25 "source": { 26 "url": "https://example.com/models/animated_character.glb" 27 }, 28 "animation": { 29 "currentIndex": 0, 30 "speed": 1.0, 31 "loop": true 32 }, 33 "sizeParams": { 34 "width": 2, 35 "height": 2, 36 "depth": 2 37 }, 38 "originalWidth": 2, 39 "originalHeight": 2, 40 "originalDepth": 2 41} 42

Notes

  • 3D elements fully integrate with the existing 2D rendering pipeline. You can mix 2D and 3D elements in the same project.
  • The camera uses pixel-perfect perspective projection, ensuring that at z=0, one world unit equals one pixel.
  • For 3D transforms, the coordinate system follows standard 3D conventions: X (right), Y (up), Z (toward viewer).
  • Material and texture properties are typically set by the editor. If you're hand-writing JSON, refer to MaterialX preset documentation for available materials.