← Back

gentoo.c

A spinning 3D Gentoo logo in your terminal. Inspired by donut.c. About 250 lines of C, no dependencies beyond libm. This is what eventually turned into fetch.

GitHub

gentoo.c demo

Build and run

cc gentoo.c -o gentoo -lm
./gentoo

Clears the screen and animates in place. Ctrl-C to stop.

How it works

The logo is embedded as an array of strings. Each ASCII character's visual density (M is heaviest, dots and dashes are lightest) maps to a height value, creating a 3D relief from the logo itself. Surface normals come from the height field gradient, giving natural shading that follows the curves of the swirl. Blinn-Phong shading with diffuse and specular highlights. Every frame it rotates every point around X and Y, projects with perspective, z-buffers, and shades by surface normal.