How pavolulicny/rasterminal works
rasterminal is a CPU-based 3D model viewer that turns a model file into an interactive terminal display. The main workflow parses launch options, loads mesh and material data, renders frames, and presents them through a terminal graphics backend; input updates the camera and viewing settings for subsequent frames. The README also documents native OBJ, PLY, STL, and glTF support, broader Assimp format support, and Kitty, Sixel, and half-block presentation. Some subsystem wiring is inferred from documentation because the sampled excerpts are partial.
Main entry points: main.cpp Viewer runtime · mesh.cpp Mesh loading · mesh.h Mesh and materials · graphics.cpp Backend selection
Components 25
Viewer runtime
- Launch options
src/args.cpp - Viewer runtime
src/main.cpp - Viewer state
src/viewer/state.h - Input controls
src/viewer/input_controller.h
Model import
- Mesh loading
src/loaders/mesh.cpp - OBJ loader
src/loaders/mesh_obj.cpp - PLY loader
src/loaders/mesh_ply.cpp - STL loader
src/loaders/mesh_stl.cpp - glTF loader
src/loaders/mesh_gltf.cpp - Assimp loader
src/loaders/mesh_assimp.cpp - Mesh and materials
src/loaders/mesh.h
CPU rendering
- Camera
src/render/camera.cpp - Renderer
src/render/renderer.cpp - Rasterizer
src/render/rasterize.cpp - Texture sampling
src/render/texture.cpp
Terminal I/O
- Input reader
src/platform/input_reader.h - Framebuffer
src/terminal/framebuffer.cpp - Backend selection
src/terminal/graphics.cpp - Kitty output
src/terminal/kitty.cpp - Sixel output
src/terminal/sixel.cpp - Half-block output
src/terminal/color.cpp - Terminal query
src/platform/terminal_query.h
Other components
- Viewer user
- Model file
- Terminal
Connections 36
- Viewer user → Viewer runtime: launches
- Viewer user → Model file: chooses
- Viewer runtime → Launch options: parses
- Viewer runtime → Mesh loading: loads model
- Model file → Mesh loading: provides file
- Mesh loading → OBJ loader: dispatches
- Mesh loading → PLY loader: dispatches
- Mesh loading → STL loader: dispatches
- Mesh loading → glTF loader: dispatches
- Mesh loading → Assimp loader: dispatches
- OBJ loader → Mesh and materials: fills
- PLY loader → Mesh and materials: fills
- STL loader → Mesh and materials: fills
- glTF loader → Mesh and materials: fills
- Assimp loader → Mesh and materials: fills
- Viewer runtime → Viewer state: initializes
- Viewer runtime → Renderer: renders frames
- Viewer runtime → Framebuffer: presents frames
- Viewer runtime → Terminal query: queries terminal
- Terminal query → Backend selection: reports capabilities
- Viewer runtime → Input reader: reads input
- Input reader → Input controls: passes events
- Input controls → Viewer state: updates settings
- Viewer state → Camera: configures
- Mesh and materials → Renderer: supplies scene
- Camera → Renderer: supplies view
- Renderer → Rasterizer: rasterizes
- Rasterizer → Texture sampling: samples textures
- Rasterizer → Framebuffer: writes pixels
- Framebuffer → Backend selection: uses backend
- Backend selection → Kitty output: selects Kitty
- Backend selection → Sixel output: selects Sixel
- Backend selection → Half-block output: selects fallback
- Kitty output → Terminal: emits graphics
- Sixel output → Terminal: emits graphics
- Half-block output → Terminal: emits colored cells