All types below are exported from @glyphcss/core unless marked with glyphcss
(the vanilla package).
Type Description Used in Vec2[u, v] tuple — UV coordinatesTextureTriangle.uvs, polygon UVsVec3[x, y, z] tuple — world-space point or vectorVertices, directions, hotspot anchors PolygonN coplanar vertices + optional color/texture Helper generators, mesh parsers TextureTriangle3 vertices + 3 UV pairs + optional color Parser-internal type for UV-mapped meshes WireframeEdgefrom/to Vec3 pair + optional weight/colorbuildRasterizeContext wireframe mode (glyphcss)
type Vec2 = [ number , number ];
type Vec3 = [ number , number , number ];
interface TextureTriangle {
vertices : [ Vec3 , Vec3 , Vec3 ];
interface WireframeEdge {
weight ?: EdgeWeight ; // 1 | 2 | 3
Type Description Used in RenderMode"wireframe" | "solid" | "voxel" | "ink"RasterizeContextOptions.mode, all framework propsCharRampstring[] — index 0 = darkest, last = brightestSolid-mode Lambert → glyph mapping EdgeWeight1 | 2 | 3 — thin / normal / coreWireframeEdge.weight
type RenderMode = " wireframe " | " solid " | " voxel " | " ink " ;
type CharRamp = string []; // e.g. [" ", ".", ":", "-", "=", "+", "*", "#", "%", "@"]
type EdgeWeight = 1 | 2 | 3 ;
Type Description Used in GlyphDirectionalLightSingle distant light source GlyphSceneOptions.directionalLightGlyphAmbientLightUniform fill light GlyphSceneOptions.ambientLight
interface GlyphDirectionalLight {
direction : Vec3 ; // source vector from surface toward the distant light
intensity ?: number ; // default 1
color ?: string ; // hex, default white
interface GlyphAmbientLight {
intensity ?: number ; // default 0.4
color ?: string ; // hex, default white
Type Description Used in GlyphShadowOptionsShadow-map configuration. undefined on the scene = shadows off GlyphSceneOptions.shadow, <GlyphScene shadow={…}>
interface GlyphShadowOptions {
color ?: string ; // shadow tint hex; default "#000000"
opacity ?: number ; // darkness 0..1 toward color; default 0.25
lift ?: number ; // depth bias — prevents self-shadow acne; default 0.05
maxExtend ?: number ; // accepted but NOT READ — the volume is fitted to the casters' own bounds
Shadow flags on meshes (GlyphMeshTransform, <GlyphMesh>, <glyph-mesh>):
Field / prop / attribute Default Description castShadow / cast-shadowfalseThis mesh casts shadows onto receiveShadow surfaces receiveShadow / receive-shadowfalseThis mesh receives shadows. Both flags on the same mesh = self-shadow
GlyphGround sets receiveShadow=true and castShadow=false by default.
Detail / density on meshes (GlyphMeshTransform, <GlyphMesh>, <glyph-mesh>) — see the Density & Detail guide :
Field / prop / attribute Type Default Description densitynumber1 (shared grid)Render this mesh at density× the scene resolution, in its own <pre> fontSize / font-sizenumber | string— Explicit cell size (px or CSS length). Overrides density lineHeight / line-heightnumber— Explicit cell line-height. Overrides density transparentbooleanfalseSee-through: doesn’t occlude / isn’t occluded (pops into its own <pre>)
Browser-only (detail layers measure the live cell size); works with any camera (orthographic, perspective, FPV).
Type Description Used in GridSize{ cols, rows, cellAspect }buildRasterizeContext, camera project()SceneContextNormalized polygons + scene bbox + warnings The .context field of buildSceneContext({ polygons })’s SceneContextBuildResult. The rasterizer takes RasterizeContext from buildRasterizeContext, not this
cellAspect : number ; // cellH / cellW — typically ~2.0
Type Description Used in HotspotA 3D anchor that projects to a 2D hitbox scene.addHotspot(), projectHotspots()HotspotCellProjected result for one frame projectHotspots() return value
size ?: [ number , number ]; // cols × rows in cells; default [1, 1]
depth : number ; // camera-space Z; use for z-index
visible : boolean ; // false when behind camera or off-grid
Type Description Used in ParseResultUnified output of all polygon-emitting parsers parseObj, parseGltf, loadMeshParseAnimationClipMetadata for one animation in a glTF file ParseResult.animation.clips
animation ?: ParseAnimationController ;
dispose : () => void ; // revoke blob URLs — always call on unmount
animations ?: ParseAnimationClip [];
interface ParseAnimationClip {
duration : number ; // seconds
Type Description Used in GlyphAnimationMixerDrives one or more animation actions against a mesh target createGlyphAnimationMixer()GlyphAnimationActionPer-clip playback state mixer.clipAction()
// Minimal usage — requires a glTF/GLB file with embedded animation clips.
// Replace "/character.glb" with the path to your own animated mesh.
import { createGlyphAnimationMixer, LoopRepeat, loadMesh } from " @glyphcss/core " ;
const { polygons , animation } = await loadMesh ( " /character.glb " );
const mixer = createGlyphAnimationMixer (meshHandle , animation ! );
const action = mixer . clipAction ( " walk " );
action . setLoop (LoopRepeat, Infinity ) . play ();
// In your animation loop (requestAnimationFrame):
mixer . update (deltaSeconds);