A small MoonBit 3D geometry foundation with core, view, frontend, TUI, Canvas, and GSAP SVG backend packages built on Luna-Flow/linear-algebra.
Dependencies
moon add Luna-Flow/geometry3d@0.5.2fn main {
let scene = @frontend.Scene::single(
@core.torus_mesh(1.6, 0.6, 24, 12),
@core.Transform3::rotation(1.1, 0.3, 0.0),
@frontend.Light::default(),
)
let view = @frontend.RenderView::perspective(
@view.Camera3::default(5.0),
@view.PerspectiveProjection::new(@view.Viewport::new(48, 16), 24.0),
)
let config = @tui.TuiRenderConfig::sized(48, 16)
println(@tui.render_scene(scene, view, config).to_string())
}import {
"Luna-Flow/geometry3d/core",
"Luna-Flow/geometry3d/view",
"Luna-Flow/geometry3d/frontend",
"Luna-Flow/geometry3d/backend/tui",
}| Package | Contents | Targets |
|---|---|---|
| core | vectors, quad meshes and generators, normals, visibility, Lambert intensity, 4×4 transforms | all |
| view | look-at camera, perspective/orthographic projection, perspective-correct depth, sensor and lens model | all |
| frontend | scenes, backend-neutral DrawList, shadow mapping, LumaBuffer, exposure, optical flow, timelines | all |
| backend/tui | character frame buffer, shade ramp, terminal aspect correction, .tuiimg/.tui3d files | all |
| backend/canvas | HTML canvas output with exact occlusion | js |
| backend/gsap | SVG polygons in painter's order, GSAP playback controller | js |
| demo | terminal demo: cube, sphere, torus, Hitchcock and dolly-zoom scenes, exposure, recording | native |
| demo_canvas, demo_gsap | browser demos of the two web backends | js |
just torus # terminal, sized from stty
just hitchcock # dolly zoom in the terminal
just canvas-serve # http://localhost:8080
just gsap-serve # http://localhost:8081
just record # write target/geometry3d-demo.tui3dmoon check --target all
bash ./run_test.sh # tests on wasm-gc, js, native, wasm, plus demo smoke runs
just ready # fmt, check, info, test matrix, coverageInstall
Download zipA small MoonBit 3D geometry foundation with core, view, frontend, TUI, Canvas, and GSAP SVG backend packages built on Luna-Flow/linear-algebra.
Dependencies