klein(6)
klein(6) β okay bestie, this is from the XScreenSaver manual and it's about to make 4d geometry feel like a group chat π β¨
π NAME π
kleinβ draws a 4d Klein bottle. That's the whole vibe, no cap. π«Ά
β¨ SYNOPSIS β¨
klein [--display host:display.screen] [--install] [--visual visual]
[--window] [--root] [--window-id number] [--delay usecs] [--fps]
[--klein-bottle bottle-name] [-figure-8] [-pinched-torus] [-lawson]
[--mode display-mode] [--wireframe] [--surface] [--transparent]
[--appearance appearance] [--solid] [--bands] [--colors color-scheme]
[--onesided] [--twosided] [--rainbow] [--depth] [--change-colors]
[--view-mode view-mode] [--walk] [--turn] [--walk-turn] [--orientation-
marks] [--projection-3d mode] [--perspective-3d] [--orthographic-3d]
[--projection-4d mode] [--perspective-4d] [--orthographic-4d] [--speed-
wx float] [--speed-wy float] [--speed-wz float] [--speed-xy float]
[--speed-xz float] [--speed-yz float] [--walk-direction float] [--walk-
speed float]
π DESCRIPTION π
Okay so klein is the program that shows you three different Klein bottles in 4d: the figure-8 Klein bottle, the pinched torus Klein bottle, and the Lawson Klein bottle. You can walk on the Klein bottle, watch it turn in 4d, or do both at once β walk on it while it turns in 4d. Iconic. π
The figure-8 one is well known in its 3d form. The 4d form used in this program is an extension of that 3d form to 4d, and it does not intersect itself in 4d β you can see that in the depth colors mode when you use static colors. The pinched torus Klein bottle also does not intersect itself in 4d (same depth colors mode + static colors situation). The Lawson Klein bottle, on the other hand, does intersect itself in 4d. Its primary use is that it has a nice appearance for walking and for turning in 3d. Slay for aesthetics, not for non-intersection. π
The Klein bottle is a non-orientable surface. To make that apparent, use the two-sided color mode. Alternatively, orientation markers (curling arrows) can be drawn as a texture map on the surface of the Klein bottle. While walking on the Klein bottle, you'll notice that the orientation of the curling arrows changes β and it must, because the Klein bottle is non-orientable. The math said what it said. π
The program projects the 4d Klein bottle to 3d using either a perspective or an orthographic projection. Which of the two alternatives looks more appealing depends on the viewing mode and the Klein bottle. For example, the Lawson Klein bottle looks nicest when projected perspectively. The figure-8 Klein bottle, on the other hand, looks nicer while walking when projected orthographically from 4d. For the pinched torus Klein bottle, both projection modes give equally acceptable projections. No notes. β¨
The projected Klein bottle can then be projected to the screen either perspectively or orthographically. When using the walking modes, perspective projection to the screen should be used. That's the move. π«Ά
There are three display modes for the Klein bottle: mesh (wireframe), solid, or transparent. Furthermore, the appearance of the Klein bottle can be as a solid object or as a set of see-through bands. Finally, the colors with which the Klein bottle is drawn can be set to one-sided, two-sided, rainbow, or depth.
In one-sided mode, the Klein bottle is drawn with the same color on both "sides." In two-sided mode (using static colors), the Klein bottle is drawn with red on one "side" and green on the "other side." Of course, the Klein bottle only has one side, so the color jumps from red to green along a curve on the surface of the Klein bottle. This mode enables you to see that the Klein bottle is non-orientable. If changing colors are used in two-sided mode, changing complementary colors are used on the respective "sides." The rainbow color mode (using static colors) draws the Klein bottle with a color wheel of fully saturated rainbow colors. If changing colors are used, the color wheel's colors change dynamically. The rainbow color mode gives a very nice effect when combined with the see-through bands mode or with the orientation markers drawn. The depth color mode draws the Klein bottle with colors that are chosen according to the 4d "depth" of the points. If static colors are used, this mode enables you to see that the figure-8 and pinched torus Klein bottles do not intersect themselves in 4d, while the Lawson Klein bottle does intersect itself. π
The rotation speed for each of the six planes around which the Klein bottle rotates can be chosen. For the walk-and-turn mode, only the rotation speeds around the true 4d planes are used (the xy, xz, and yz planes). Keep that in mind, bestie. π§
Furthermore, in the walking modes the walking direction in the 2d base square of the Klein bottle and the walking speed can be chosen.
This program is somewhat inspired by Thomas Banchoff's book "Beyond the Third Dimension: Geometry, Computer Graphics, and Higher Dimensions", Scientific American Library, 1990. Bibliographic slay. ππ
π OPTIONS β¨
okay bestie, klein accepts the following options, and there are a lot of them, but we're gonna get through this together β grab a strawberry π and let's go.
--windowβ draw on a newly-created window. This is the default, so it's giving "main character energy" without you even asking.--rootβ draw on the root window. lowkey living that full-screen backdrop life.--window-id numberβ draw on the specified window. you pick the window, bestie, and it slays there.--installβ install a private colormap for the window. it's giving "personalized palette, no sharing" π--visual visualβ specify which visual to use. legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. short and specific β we love to see it.--delay microsecondsβ how much of a delay should be introduced between steps of the animation. default10000, or1/100thsecond. tiny pause, big vibe.--fpsβ display the current frame rate, CPU load, and polygon count. it's giving "stats on stats" and honestly? obsessed.
the following three options are mutually exclusive, bestie β they determine which Klein bottle is displayed. choose your fighter:
--klein-bottle randomβ display a random Klein bottle (default). chaos is the vibe β¨--klein-bottle figure-8(shortcut:--figure-8) β display the figure-8 Klein bottle. iconic shape, no notes.--klein-bottle pinched-torus(shortcut:--pinched-torus) β display the pinched torus Klein bottle. she's pinched and she's proud π--klein-bottle lawson(shortcut:--lawson) β display the Lawson Klein bottle. a whole named moment.
the following four options are mutually exclusive β they determine how the Klein bottle is displayed:
--mode randomβ display the Klein bottle in a random display mode (default). surprise, bestie π--mode wireframe(shortcut:--wireframe) β display the Klein bottle as a wireframe mesh. skeleton realness, fr fr.--mode surface(shortcut:--surface) β display the Klein bottle as a solid surface. full-body slay.--mode transparent(shortcut:--transparent) β display the Klein bottle as a transparent surface. see-through and unbothered π¦
the following three options are mutually exclusive β they determine the appearance of the Klein bottle:
--appearance randomβ display the Klein bottle with a random appearance (default). let fate decide, honestly.--appearance solid(shortcut:--solid) β display the Klein bottle as a solid object. solid like your fave's opinions.--appearance bands(shortcut:--bands) β display the Klein bottle as see-through bands. stripes but make it 4d π
the following five options are mutually exclusive β they determine how to color the Klein bottle:
--colors randomβ display the Klein bottle with a random color scheme (default). prismatic chaos, no cap.--colors one-sided(shortcut:--onesided) β display the Klein bottle with a single color. monochrome queen π--colors two-sided(shortcut:--twosided) β display the Klein bottle with two colors: one color one "side" and the complementary color on the "other side." for static colors, the colors are red and green. duality is the moment.--colors rainbow(shortcut:--rainbow) β display the Klein bottle with fully saturated rainbow colors. if the Klein bottle is displayed as see-through bands, each band will be displayed with a different color. rainbow band moment, literally πβ¨--colors depth(shortcut:--depth) β display the Klein bottle with colors chosen depending on the 4d "depth" of the points. depth check but make it pretty π
the following options determine whether the colors with which the Klein bottle is displayed are static or are changing dynamically:
--change-colorsβ change the colors with which the Klein bottle is displayed dynamically. she's alive, bestie π«--no-change-colorsβ use static colors to display the Klein bottle (default). calm, collected, same palette.
the following four options are mutually exclusive β they determine how to view the Klein bottle:
--view-mode randomβ view the Klein bottle in a random view mode (default). roll the dice, bestie π²--view-mode walk(shortcut:--walk) β view the Klein bottle as if walking on its surface. going for a lil stroll, no big deal.--view-mode turn(shortcut:--turn) β view the Klein bottle while it turns in 4d. rotating queen behavior.--view-mode walk-turn(shortcut:--walk-turn) β view the Klein bottle as if walking on its surface. additionally, the Klein bottle turns around the true 4d planes (thexy,xz, andyzplanes). walking and turning? multitasking icon.
the following options determine whether orientation marks are shown on the Klein bottle:
--orientation-marksβ display orientation marks on the Klein bottle. little labels, big helpful energy π--no-orientation-marksβ don't display orientation marks on the Klein bottle (default). clean face, no notes.
the following three options are mutually exclusive β they determine how the Klein bottle is projected from 3d to 2d (i.e., to the screen):
--projection-3d randomβ project the Klein bottle from 3d to 2d using a random projection mode (default). surprise math, slay.--projection-3d perspective(shortcut:--perspective-3d) β project the Klein bottle from 3d to 2d using a perspective projection. depth and drama.--projection-3d orthographic(shortcut:--orthographic-3d) β project the Klein bottle from 3d to 2d using an orthographic projection. no foreshortening, only facts.
the following three options are mutually exclusive β they determine how the Klein bottle is projected from 4d to 3d:
--projection-4d randomβ project the Klein bottle from 4d to 3d using a random projection mode (default). 4d chaos, but make it aesthetic.--projection-4d perspective(shortcut:--perspective-4d) β project the Klein bottle from 4d to 3d using a perspective projection. perspective but extra-dimensional.--projection-4d orthographic(shortcut:--orthographic-4d) β project the Klein bottle from 4d to 3d using an orthographic projection. flat and correct, periodt.
the following six options determine the rotation speed of the Klein bottle around the six possible hyperplanes. the rotation speed is measured in degrees per frame. the speeds should be set to relatively small values, e.g., less than 4 in magnitude. in walk mode, all speeds are ignored. in walk-and-turn mode, the 3d rotation speeds are ignored (i.e., the wx, wy, and wz speeds). in walk-and-turn mode, smaller speeds must be used than in the turn mode to achieve a nice visualization. therefore, in walk-and-turn mode the speeds you have selected are divided by 5 internally. yes bestie, the math is mathing π₯
--speed-wx floatβ rotation speed around thewxplane (default:1.1).--speed-wy floatβ rotation speed around thewyplane (default:1.3).--speed-wz floatβ rotation speed around thewzplane (default:1.5).--speed-xy floatβ rotation speed around thexyplane (default:1.7).--speed-xz floatβ rotation speed around thexzplane (default:1.9).--speed-yz floatβ rotation speed around theyzplane (default:2.1).
the following two options determine the walking speed and direction:
--walk-direction floatβ the walking direction is measured as an angle in degrees in the 2d square that forms the coordinate system of the surface of the Klein bottle (default:7.0). pick a direction, bestie π§--walk-speed floatβ the walking speed is measured in percent of some sensible maximum speed (default:20.0). not too fast, not too slow β sensible maximum speed, iykyk.
π±οΈ INTERACTION π±οΈ
if you run this program in standalone mode in its turn mode, you can rotate the Klein bottle by dragging the mouse while pressing the left mouse button. this rotates the Klein bottle in 3D, i.e., around the wx, wy, and wz planes. if you press the shift key while dragging the mouse with the left button pressed the Klein bottle is rotated in 4D, i.e., around the xy, xz, and yz planes. to examine the Klein bottle at your leisure, it is best to set all speeds to 0. otherwise, the Klein bottle will rotate while the left mouse button is not pressed. this kind of interaction is not available in the two walk modes. okay so drag with left button = 3D rotation, Shift + drag = 4D rotation, and if you want her to hold still you gotta set all speeds to 0 β no cap π
heads up bestie: that interaction is not available in the two walk modes, so don't go looking for it there π
πΈ ENVIRONMENT πΈ
DISPLAYβ to get the default host and display number.XENVIRONMENTβ to get the name of a resource file that overrides the global resources stored in theRESOURCE_MANAGERproperty.XSCREENSAVER_WINDOWβ the window ID to use with--root.
π¦ SEE ALSO π¦
X(1), xscreensaver(1) β go read those too, bestie, they're part of the lore π
π COPYRIGHT π
Copyright Β© 2005-2020 by Carsten Steger.
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
legal bit, but important β read it, don't skip it, it's giving realness π«Ά
π AUTHOR π
Carsten Steger <carsten@mirsanmir.org>, 11-jan-2020. iconic, honestly.
and that's the whole page, bestie β¨ this little masterpiece is X Version 11, version 6.15 (30-Mar-2026), and it lives at klein(6) β periodt π
π
π¦ where this page comes from
- alpine 3.24: xscreensaver-doc 6.15-r0 Β· GPL-2.0-or-later GPL-3.0-or-later 0BSD MIT
- arch rolling: xscreensaver 6.15-1 Β· LicenseRef-XScreenSaver
- nixpkgs unstable: xscreensaver 6.15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms