1 · the spec, also saved as SPEC.md
# SPEC: what the Taj build must expose and deliver
## Scene rules
- Pure code. No 3D model files, image textures, HDRIs or downloaded assets. Three.js and its official add-ons only, vendored in this folder (no CDN at runtime). List the add-ons you use.
- Units are metres. The origin is the centre of the plinth top. +Y is up. +Z points toward the main gate (south).
## window.taj (available once the page script runs)
```js
window.taj = {
ready: Promise<void>, // resolves after the first 3D frame is drawn
views: ['front', 'oblique', 'plan', 'hero'],
setView(name): void, // jump to that camera, no animation
setSpin(on: boolean): void, // orbit around the dome axis, 1 turn per 40 s
setTime('sunrise' | 'noon'): void,
measure(): { // metres, from mesh bounding boxes in world space, never from config constants
plinthSide, plinthHeight, tombWidth, tombHeight,
domeHeight, domeMaxDiameter, // outer dome shell only (no drum, no finial)
innerDomeDiameter, drumHeight,
finialTop, // finial tip above the plinth top
minaretHeight, poolLength
},
stats(): { triangles, meshes, drawCalls, jsBytes }
};
```
## Fixed cameras
| View | Position (x, y, z) | Target | FOV |
|---|---|---|---|
| front | (0, 35, 260) | (0, 35, 0) | 35 |
| oblique | (170, 90, 170) | (0, 30, 0) | 35 |
| plan | (0, 320, 0.01) | (0, 0, 0) | 35 |
| hero | (60, 25, 210) | (0, 40, 0) | 40 |
## Page
- Poster first: a still of the hero view's first sunrise frame. 3D starts on tap.
- `?embed=1`: no page text or buttons at all, just the scene; it starts 3D at once (the parent page gives the user gesture). `?autostart=1` skips the poster.
- No network requests except this folder's own files. No server, no upload or save endpoint.
- Phone: under 150,000 scene triangles on a 390 px wide screen.
## Deliver in this folder
index.html, src/, vendor/, poster image, sources.json (one row per value you used: value, what it measures, status cited | assumption | disputed, source URL), measurements.json (measure() and stats() at 390 px and 1440 px), screenshots/ (the four fixed cameras at 1440x900, sunrise), CHANGES.md (what you built, your self-audit of measure() against sources, known limits), PROMPTS.md (every prompt you received, word for word). Do not put repository URLs, account names or personal names in any file. 2 · the brief
Message 1 (once, at the start):
Build the Taj Mahal in Three.js, entirely from code, in this folder. Follow SPEC.md exactly.
Research the real dimensions yourself from published sources. Prefer the Archaeological Survey of India, UNESCO and peer-reviewed papers. Every dimension you use goes into sources.json with what it measures, its status and the source URL. Where sources disagree, say so; don't pick silently.
Get the proportions right: the raised plinth, the main tomb with its pishtaq arches, the double dome (outer onion shell and inner dome) on its drum, the finial, the four chhatris, the four minarets, the mosque and the jawab, the char bagh garden with its water channels, and the long reflecting pool. Sunrise light, white marble. Make it beautiful enough to stop someone scrolling.
After each round, take the four fixed-camera screenshots, look at them, compare them with the real Taj Mahal, and commit "round N: <what changed>". Log every prompt you receive in PROMPTS.md.
Message 2 (send it exactly 3 times, each time after the tool finishes):
Look at your latest screenshots and compare them with the real Taj Mahal. Fix the three biggest differences, keep SPEC.md working, take new screenshots, and commit as the next round.
Message 3 (once, at the end):
Finish: run measure() and stats() at 390 px and 1440 px, write measurements.json and CHANGES.md with your self-audit against sources.json, and commit "final".