Home /Modules/bash/README.md

README.md

bash/model-3D/README.md · 164 line(s) · markdown

<img align="right" src="https://github.com/mearvk/SLeeLa/blob/master/images/debian/debian-logo.png" width="75" height="75" alt="SLeeLa">

<img src="https://github.com/mearvk/SLeeLa/blob/master/images/sleela/sleela-logo-004.jpg" alt="SLeeLa">

model-3D — SleelaTerminal™ · Phraign™ City 3D

Part of SleelaTerminal™, SLeeLa's terminal product, built on GNU Bash (GPL, © Free Software Foundation). This directory is a SLeeLa-authored application; the vendored GNU Bash sources are untouched.

Phraign™ City 3D is the flagship SleelaTerminal™ application. It generates a sprawling, modern city model of ~4000 square blocks and renders it — on a per-pixel basis — onto a Phraign™ frame. The city is a model of finality (quality of condition) designed from three drivers: the Year (modernity), the person's IQ (design quality / order), and the person's native Legislature (the regime that produces the city's lines and linear outcomes). A more modern year, higher IQ, and a given legislature together yield a newer, better-planned city with a distinct linear structure. It is viewed from the top and off to one side at a slight angle, the whole viewpoint is config-driven, and a model is generated per user and can be saved to GitHub or a public server.

Green (default)

What it does

Themes

Green (default)WhiteBlue
greenwhiteblue

Layout

model-3D/
├── README.md          this file
├── CONFIG.md          config file reference
├── MODEL_FORMAT.md    the PHRAIGN-CITY serialization format
├── city.config        default configuration
├── Makefile           self-contained build (pulls Phraign from ../)
├── RENDER_MATH.md     rendering math + rendering group reference
├── CITYSCAPE_MODEL.md the general model (graph, radix/diameter/randomness)
├── city_model.hpp/.cpp      model, palette, config, generation, serialization
├── cityscape_model.hpp/.cpp the general graph: centricity, cylinders, spheres
├── render_math.hpp/.cpp     vectors, color math, oblique projection, quad fill
├── render_group.hpp/.cpp    RenderSink over Phraign + ordered drawable group
├── city_renderer.hpp/.cpp   builds a rendering group from a City + graph
├── city3d.cpp              command-line driver (generate / render / save)
├── city3d_smoke.cpp        model/config/render smoke test
├── render_smoke.cpp        rendering math + group smoke test
├── samples/               rendered previews (green/white/blue)
└── modeling/              city model data (.city files)

Build & run

cd bash/model-3D
make            # builds ./build/city3d and ./build/city3d_smoke
make smoke      # run the smoke test
make demo       # generate a model + a PPM preview from city.config

# Generate a per-user city, write the model and a preview image:
./build/city3d generate --config city.config --out modeling/mycity.city \
    --ppm build/mycity.ppm

# Render a saved model (optionally with a different view config):
./build/city3d render --model modeling/mycity.city --config city.config \
    --ppm build/mycity.ppm

# Print the save plan for the configured target (github|server|local):
./build/city3d save --model modeling/mycity.city --config city.config

The --ppm preview is a portable dump of the exact Phraign per-pixel frame, viewable in any image viewer (or convertible to PNG).

How the pieces relate

city.config ──► Config ──► City.generate(seed)     (per-user, ~4000 blocks)
                              │
                              ▼
                     city_renderer ── builds quads via ──► render_math
                              │                            (ObliqueCamera, Quad)
                              ▼
                        render_group  (ordered quads, painter depth)
                              │  draw() per pixel via PhraignSink
                              ▼
                 Phraign™ PixelTerminal frame  ──►  preview (PPM/PNG)
                              │
                              ▼
        PHRAIGN-CITY model text  ──►  GitHub / public server / local

See ../PHRAIGN.md for the Phraign™ frame system this renders onto.

Notes & possible next steps