$ show SolarLune/tetra3d
Tetra3D is a pure-Go 3D game engine and rendering library built on top of Ebiten (a 2D game library). It provides a full scene graph with nodes, models, cameras, lights, materials, and animations, along with collision detection, particle systems, text rendering, and pathfinding grids. The architecture is a library with a rich set of examples demonstrating each feature. Key entry points include the tetra3d package root, Camera.RenderScene() for rendering, and gltf.LoadGLTF() for asset loading. Data flows involve loading GLTF/GLB files (with custom Blender exporter metadata), constructing a scene graph, and rendering per frame with support for lighting, shadows, and transparency. External dependencies are Ebiten for rendering/input, qmuntal/gltf for GLTF parsing, tanema/gween for tweening, and golang.org/x/image for font rendering. The codebase includes SIMD-optimized matrix math, a comprehensive vector library, and a Blender addon for exporting scenes with engine-specific properties.
The LLM identified 5 files worth highlighting for reuse:
Provides a 4x4 matrix (Matrix4) implementation with SIMD-accelerated multiplication on amd64 (matrix_amd64.s, matrix_simd.go) and a generic fallback (matrix_none.go). Includes inversion, rotation/translation constructors, and projection helpers. This is a self-contained math component that could be extracted as a standalone library for any 3D application.
Implements Vector3 and Vector2 with a full set of operations: Add, Sub, Scale, Dot, Cross, Angle, Slerp, Round, Floor, Ceil, and more. Also includes ModVector for in-place mutation. This is a clean, reusable vector math library suitable for any 3D or 2D graphics project.
Provides float32 math wrappers (Mod, FMA, etc.) and quaternion operations (multiplication, dot product, ToMatrix4). Designed for consistent float32 precision in game engines. Reusable as a standalone math utility package.
Defines Color4 and Color3 with methods for sRGB conversion, HSV/HSL helpers, and ColorCurve for animated color interpolation with easing. This is a self-contained color management module that can be reused in any rendering or UI project.
A Blender addon that exports scenes to Tetra3D's custom glTF format, embedding engine-specific metadata (game properties, camera settings, material flags, auto-subdivision, grid data, etc.). It provides operators for property management and UI panels. This addon is a reusable template for building custom glTF exporters with Blender.