Added glass and metal objects

This commit is contained in:
The Dust Council 2026-06-03 18:25:03 -07:00
parent 926008e491
commit 3fa044013a
7 changed files with 2103 additions and 38 deletions

120
README.md
View file

@ -3,7 +3,7 @@
A starfield simulator — except instead of stars, colorful **vector-drawn
platonic solids** tumble through space toward the camera.
**~165 shape types** are rendered as glowing wireframes — each spawns far away
**~530 shape types** are rendered as glowing wireframes — each spawns far away
at a random size, tumbles on its own random axis, and streams past the camera
before being recycled at the render-distance sphere. Solids never overlap.
@ -33,7 +33,69 @@ The shape set includes:
question mark, exclamation point, hash/pound (`#`), dollar sign (`$`), pound
sterling (`£`), and the **at sign (`@`)**
- **Object iconography**, each in **2-D** and **3-D**: space invaders, UFOs,
pac-man, alien heads, smoking pipes, umbrellas, and hands
pac-man and pac-man ghosts, alien heads, smoking pipes, umbrellas, hands,
ice cream cones, light bulbs, mitochondria, windowpanes, bowling balls and
pins, baseball bats, beer bottles, nonic pint glasses, whiskey bottles,
telephones, telephone booths, radio towers, and atoms with orbiting electrons
(the volumetric bowling ball is a true wireframe sphere, and the 3-D atom has
real orbits + nucleus + electron balls rather than a flat extrusion)
- **More 3-D objects** — many built as true **solids of revolution** (a profile
lathed around an axis): a full **chess set** (pawn, rook, bishop, knight,
queen, king), candlesticks with a flame, coffee cups, lanterns, hurricane
lamps, quartz crystals, pineapples, and a parametric **torus** — plus extruded
silhouettes of padlocks, antique keys, bananas, electric guitars, tacos, pizza
slices, hammers, wrenches, directional and drafting compasses, set-squares,
eyeglasses, forks, spoons, fountain pens, the four classical element symbols
(fire/water/air/earth), the squared-circle "philosopher's stone", a couple of
retro stylized gaming/OS marks, a retro joystick, and a generic starship
- **Even more objects** in 2-D and 3-D: top hats, baseball caps, noses, hearts,
computer keyboards, floppy disks, bells, books, and two more stylized retro
computer marks. Every representational *object* now has both a flat 2-D and a
3-D form — the once-3-D-only chess pieces, lathed solids, torus, and atomic
starbursts all gained matching 2-D silhouettes.
- **Yet more**, all in 2-D and 3-D: IC chip packages (DIP, QFP, PGA, and a
generic CPU — the styles behind the 6502/Z80/386/486 and friends), hot dogs,
hamburgers, monoliths, ringed planets, unicycles, hula hoops, mechanical
gyroscopes, microscopes, telescopes, **magnifying glasses that actually
magnify the field behind them**, thermometers, calculators, staplers, paper
clips, palm trees, saguaro cacti, grape bunches, sushi rolls, corkscrews (a
real 3-D helix), bottle openers, lightning bolts, and batteries
- **An even bigger batch** in 2-D and 3-D: everlasting gobstoppers, pants,
shirts, jacks, dice, K/Q/J/A playing cards, roulette wheels, slot machines,
fire hydrants, bucky balls (a real truncated icosahedron), yo-yos, brains,
d6 and d20 dice, thimbles, automobiles, couches, stop signs, office chairs,
DNA double helices, skull-and-crossbones, goldfish, squid, pine cones, maple
leaves, sea anemones, wagon wheels, submarines, sailing ships, anchors, swiss
cheese wedges, and the anarchy symbol
- **Animated objects** (the 3-D form is rebuilt every frame): a **Hoberman
sphere** that unfolds and folds, a **Rubik's cube** whose top layer turns, a
**spinning top** and **dreidel** that precess, a **lighthouse** with a beam
that sweeps around, a **blinking eyeball**, a **skull with a chattering jaw**,
**chattering teeth**, an **octopus** with waving arms, a **jellyfish** with
drifting tentacles, a **fish** swimming with a flapping tail, **scissors**
that scissor, **flickering flames** (free and on a zippo lighter), and
**spinning gears** and a **spinning fan**
- A **3-D refracting prism**: a triangular glass prism that takes a white beam
in one face and splits it into a full rainbow spectrum fanning out the other —
the colours are drawn straight into the shape, independent of the field hue
- A **3-D glass sphere** (crystal ball): a real ball lens that grabs the field
behind it and shows it **inverted and fish-eye-distorted**, with a bright
fresnel rim and a specular reflection highlight. Like the magnifier it samples
the grabbed framebuffer, but with an inverting non-linear radial warp
- An **opaque polished mirror sphere** (chrome ball): a convex mirror that
**reflects the surrounding field upright** in a wide fish-eye — the optical
opposite of the glass ball (which inverts what's behind it). It has metallic
sky/ground shading so it reads as a solid metal ball even over empty space,
plus a sharp specular highlight. The magnifier, glass-ball and mirror-ball
**counts are each user-settable (01000)** — these are *extra* bodies added on
top of the density field, so dialling them up never thins out the normal shapes
- **Still more** in 2-D and 3-D: cassette tapes, vinyl records, CDs, quarters,
kites, baseballs, a police box, roses, shoes, boots, pianos, clouds, soup
cans, icebergs, pyramids (a real square pyramid in 3-D), bombs, combs, train
crossing signs, mailboxes, ship's wheels, axes, popcorn, teapots, church
bells, anvils, book stacks, springs and slinkies (real 3-D helices), extra
old keys, and a set of traditional alchemical and occult symbols (sulfur,
mercury, salt, antimony, pentagram, ankh, all-seeing eye, triple moon)
- **Live clocks** (analog and digital, 2-D and 3-D) that show the **actual
current time** — their geometry is rebuilt every frame, so the analog hands
sweep and the seven-segment digital display ticks along in real time
@ -55,6 +117,46 @@ make
./vectorgons # or: make run
```
## Windows 11 (cross-compiled from Linux)
A self-contained `vectorgons.exe` can be cross-compiled with the
**MinGW-w64** toolchain. It statically links GLFW and the GCC/threads runtime,
so on Windows it needs **only system DLLs** (`opengl32`, `glu32`, `gdi32`,
`user32`, `shell32`, `kernel32`) — just copy `vectorgons.exe` to a Windows 11
machine and double-click it. No console window, no extra DLLs.
```sh
# 1. toolchain: sudo apt install gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev
# 2. GLFW: download the WIN64 binaries from https://www.glfw.org/download
# 3. build:
make windows WINCC=x86_64-w64-mingw32-gcc GLFWDIR=/path/to/glfw-3.4.bin.WIN64
make screensaver WINCC=x86_64-w64-mingw32-gcc GLFWDIR=/path/to/glfw-3.4.bin.WIN64
```
The legacy immediate-mode OpenGL it uses (and the `glu32` perspective helpers)
are provided by the standard Windows OpenGL driver, so it runs on any Windows 11
box with working GPU drivers.
### Screensaver (`vectorgons.scr`)
`make screensaver` builds the **same program as a Windows screensaver** (it's
the same source with `-DSCREENSAVER`, output named `.scr`). It handles the
standard screensaver command line:
- **`/s`** (or no argument) — run full-screen on the primary monitor; **any key,
mouse click, or real mouse movement exits**. The on-screen control panel is
hidden.
- **`/c`** — show a short configuration dialog. There are no in-saver controls;
the saver simply uses whatever settings the main app last saved (see below),
so run `vectorgons.exe`, dial in the look you want, quit, and the saver picks
it up.
- **`/p`** — preview (the little monitor in Windows' settings); not supported, so
it exits cleanly and the preview stays blank.
To install on Windows: right-click `vectorgons.scr`**Install** (or copy it to
`C:\Windows\System32` and choose it under *Settings → Personalization → Lock
screen → Screen saver*). Like the `.exe`, it needs only Windows system DLLs.
## Settings persistence
Your settings are saved automatically on exit to `~/.vectorgons` (a plain
@ -87,6 +189,9 @@ out over a few seconds. Press any key to bring it back.
| Color mode | `M` | Toggle **single-hue****multicolor** |
| Glow | `O` / `L` | CRT glow / light bleed around vectors |
| Flicker | `G` / `H` | Vector flicker intensity |
| Magnifier count | `B` / `P` | How many magnifying glasses are on screen (01000, ±1 per press; extra, on top of the density field) |
| Glass-ball count | `1` / `2` | How many refracting glass spheres are on screen (01000) |
| Mirror-ball count | `3` / `4` | How many reflecting mirror spheres are on screen (01000) |
| Shapes | `N` | Toggle random ⇄ cycling shape spawns |
| Fullscreen | `F` or `F11` | Toggle fullscreen |
| Pause | `Space` | |
@ -141,6 +246,17 @@ out over a few seconds. Press any key to bring it back.
ghost copies bloom that glow into a larger volume than the hardware line-width
cap (~10px) could reach on its own. The crisp core is drawn last so the vector
stays sharp; the glow setting scales the mist's spread and brightness.
- **Magnifying glasses** are real lenses. After the field is drawn, the back
buffer is grabbed into a texture (`glCopyTexSubImage2D`); each lens body is
then projected to its screen position and drawn as a disc that samples that
texture with a radial zoom — so the wireframes behind the glass appear
genuinely enlarged, with the rim and handle drawn on top. (Pure legacy GL, so
it works on the Linux, Windows, and screensaver builds alike.)
- **Glass and mirror spheres** reuse the same grabbed-framebuffer trick. The
glass ball resamples it with an *inverting* fish-eye warp (refraction). The
mirror ball is a convex mirror: it samples *outward* from its centre with an
*upright* fish-eye, so the surrounding shapes wrap onto its surface the right
way up, over an opaque metallic sky/ground gradient with a specular highlight.
- **Flicker** randomly dips each solid's brightness per frame, scaled by the
flicker setting.
- **Rendering** uses legacy OpenGL immediate mode (`GL_LINES`) with additive