Documentation Index
Fetch the complete documentation index at: https://mintlify.com/danielitoCode/Spatial/llms.txt
Use this file to discover all available pages before exploring further.
Element is the façade you use to place 3D primitives inside a Scene content block. Each function in the Element object registers a SceneNode in the running scene graph — the same declarative, recomposition-driven model you already know from Jetpack Compose. Three mesh shapes are available in Core #1.
Available Primitives
Element.Cube
A unit cube mesh. Great for boxes, walls, floors, or any rectangular solid.
Element.Sphere
A sphere mesh. Ideal for balls, decorative objects, or planet-style renders.
Element.Plane
A flat quad mesh. Perfect for floors, backgrounds, and shadow-receiver planes.
Signatures
Each primitive accepts a single optionalModifier3D that controls its position, rotation, and size in world space:
Placing Elements
The following example places all three primitives in one scene. The values are taken directly from the library’s sampleMainActivity:
Plane above is sized to 8 × 0.1 × 8 meters and pushed down by 1.2 meters to act as a floor below the cube and sphere.
Using Elements Reactively
BecauseElement.* composables follow the same recomposition rules as any other @Composable, you can conditionally include or exclude them based on Compose state:
showSphere flips, the scene graph is rebuilt on the next recomposition and the render host draws the updated list automatically.
Flat-color material is the default rendering mode in Core #1. PBR shading, textures, and custom materials are out of scope for this release.
Related
- Modifier3D — position, rotate, and scale elements in 3D space
- Scene — the root composable that hosts all elements