Files
AgentCompany/landing/components/world/voxel.ts
T
ZacharyZhang-NYandClaude Opus 5.5 2d7af224dd
CI / Typecheck, lint, tests, e2e (push) Failing after 3m51s
Website: 16-bit pixel-art rebuild with a live Three.js office, downloads from Gitea v1.5.1
- Title screen over a real-time voxel office rendered at low resolution and quantized to a rotating 32-colour palette with Bayer dithering; day part and season re-light the scene and every surface.
- 16-bit UI kit: name-plate dialogs, menu cursor, inventory, XP bar, badges, NPC speech, GAME OVER with CONTINUE, hand-placed 12x12 icons, Fusion Pixel font (Latin subset preloaded).
- Sections as a game: quest log (onboarding), character select (AI CEO / AI Co-Founder), inventory (features), party roster (providers), live download XP, save point (all v1.5.1 builds), FAQ as NPC dialog, credits.
- Downloads and source point to the Gitea release; the download function only redirects to git.zacharyzhang.com.
- Tailwind and the old components removed; unit tests for platform/downloads, rewritten e2e suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 23:37:23 -04:00

27 lines
982 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { BoxGeometry, Mesh, MeshLambertMaterial, type Material, type Object3D } from "three";
import { PALETTE_SIZE } from "../../lib/palette";
export const UNIT_BOX = new BoxGeometry(1, 1, 1);
/** One Lambert material per palette index, recoloured in place whenever the palette rotates. */
export type Inks = MeshLambertMaterial[];
export function createInks(): Inks {
return Array.from({ length: PALETTE_SIZE }, () => new MeshLambertMaterial());
}
export function paintInks(inks: Inks, colours: string[]): void {
inks.forEach((material, index) => material.color.set(colours[index]!));
}
/** Adds a w×h×d box whose bottom sits at y. */
export function box(parent: Object3D, material: Material, w: number, h: number, d: number, x: number, y: number, z: number): Mesh {
const mesh = new Mesh(UNIT_BOX, material);
mesh.scale.set(w, h, d);
mesh.position.set(x, y + h / 2, z);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}