Files | |
| binary_matrix.cpp | |
Binary Matrix is a 3D variant of the Matrix rain demo. It renders 0 and 1 glyphs as depth-aware sprites over a shader-driven background, then places the result inside an orbital camera scene.
The example renders a field of independent rain streams. Each stream chooses between 0 and 1 glyphs, advances at its own speed, and fades through a short trail so the columns feel layered instead of flat.
The digits are rendered with SDL_ttf into off-screen surfaces, converted into VK_Sprite3D batches, and drawn inside a 3D camera. A separate background sprite receives the mouse position and button state every frame so the backdrop reacts to input even though the main scene is mostly keyboard-driven. The glyph tint can be overridden with --color.