summaryrefslogtreecommitdiffstats
path: root/_projects/matrix-digital-rain.md
blob: f9a1a22783fa83bfba4aa8eff07bf3c9bbf037b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
title: The Matrix digital rain
date: 2024-01-12
thumbnail: thumb.png
layout: post
---

The famous digital rain from The Matrix, implemented in C.

<video style="max-width:100%;" controls="" poster="thumb.png">
  <source src="matrix.mp4" type="video/mp4">
</video>

This project is a fork of Domsson's beautiful <a
href="https://github.com/domsson/fakesteak" class="external" target="_blank"
rel="noopener noreferrer">Fakesteak</a>.

There are three color settings: head, tail, and background. They are configured
by setting the 24-bit RGB channels using `COLOR_*_RED`, `COLOR_*_GRN`, and
`COLOR_*_BLU` definitions. The ghosting effect of old monochrome screens is
achieved by scaling the RGB channels. This results in a rain effect that
closely resembles the original from the first Matrix movie.

In addition, this implementation supports UTF-32 character sets. The
`UNICODE_MIN` and `UNICODE_MAX` controls the Unicode block used. For
instance, setting them to `0x30A1` and `0x30F6` rains Katakana:

<img style="width: 100%;" src="katakana.png" />

Files: [source.tar.gz](source.tar.gz)