# 3D House — floor plan to a 3D house you can walk through ## Goal You're turning the picture I attached (a printed floor plan, a blueprint, a screenshot of a listing, or a hand sketch on a napkin) into ONE HTML file: a 3D model of that house that I can spin, walk through and measure, shown right here in the chat. If I did not attach a picture, ask me for one and stop. - **Intro.** The page opens on the house from high above and the camera glides down into a cut-open "dollhouse" view, then sways slowly by itself until I touch it. - **The house.** Walls 2.6 m high with the tops cut away so I can look into every room, real openings for doors and windows, glass in the windows, curtains inside (not in bathrooms). Warm wood floors in living rooms, bedrooms, offices and halls, tiles in kitchens, bathrooms and laundries, decking outside. Every room is furnished by its type and size, away from the doors: sofa, armchair, coffee table, rug, TV, bookshelf and plants in the living room; counters, sink, hob, fridge, wall cabinets and an island with stools in the kitchen; a table with chairs in the dining room; a bed, nightstands, wardrobe and dresser in bedrooms; toilet, basin, shower or tub in bathrooms; desk and chair in an office; washer and dryer in a laundry. - **The garden.** Striped lawn, a hedge around the plot, round trees, flower beds, a path to every outside door, patio furniture by the patio door or on the terrace, and a swimming pool with a stone edge, loungers and a parasol when the plan shows one. Soft sun with shadows. - **Four views** in a glass bar at the top, the active one in orange, keys 1 to 4: - **Overview (1):** drag to spin, scroll or pinch to zoom. A small tag floats over every room (coloured dot, name, area); tap a tag and the camera flies to that room. - **Walk (2):** eye-height walk with WASD or arrow keys and drag to look, a joystick on phones, solid walls, doors let you through, a mini-map in the corner. - **Plan (3):** top-down plan with dimension lines, every room's size and area, and a Units button that switches metres and feet. - **Tour (4):** the camera glides through every room by itself. - A card at the bottom left with the house name, the total area and the number of rooms. Works on phones and computers, light and dark mode. The 3D engine is complete, tested JavaScript, given below in "The code", and must be used **verbatim**: the look, the furniture placement, the garden, the camera, the tour, the collisions and the whole interface already live in it. Your work is three things: read the plan exactly, write the house as a small JSON object, and put that JSON into the engine. Then check the result against "Done when" and reply in the format below. Do it all in one go; don't ask questions first (except for a missing picture). ## How to build it (aim for a finished answer in 2 to 3 minutes) - **Never type the engine by hand when you can run code.** Find this message as a file (in claude.ai pasted text is usually under /mnt/user-data/uploads/; otherwise run `grep -rl "John Savage super prompt" /mnt /tmp /home 2>/dev/null | head`), save your JSON as `house.json`, and run: ```python import json text = open(PROMPT_FILE, encoding="utf-8").read() start, end = "", "" # split so they only match the engine eng = text[text.index(start): text.rindex(end) + len(end)] plan = json.load(open("house.json", encoding="utf-8")) # also checks the JSON is valid a = eng.index("/*__PLAN__*/") + len("/*__PLAN__*/"); b = eng.index("/*__PLAN_END__*/") html = eng[:a] + "\nconst PLAN = " + json.dumps(plan) + ";\n" + eng[b:] assert html[:a] == eng[:a] and html.endswith(eng[b:]) # nothing else changed open("house.html", "w", encoding="utf-8").write(html) print(len(eng), len(html)) ``` Then show `house.html` as an artifact (or give it as a file) so the house opens right in the chat. - Only if you cannot run code at all: output the engine exactly, character for character, as one HTML artifact, with only the line between `/*__PLAN__*/` and `/*__PLAN_END__*/` replaced by `const PLAN = ;`. - Do NOT read, analyse, "improve" or shorten the engine. Trust it for furniture, walls, openings, open-plan boundaries, the tour and collisions; never simulate how it will behave. - **Time budget: about 2 minutes of looking and thinking, then write.** Study the picture once (zoom into the labels if you need to), then write the whole JSON in ONE pass, build, reply. Do NOT plan the tour or walking routes, check how rooms connect for the camera, place furniture, design doorways "so the tour works", or re-check positions more than once: the engine does all of that. Put a door wherever the plan shows one; between open-plan spaces leave no wall. If something is unclear, pick the simplest sensible answer and call it "estimated". A slightly wrong door position is fine; the user fixes it in one line. ## Read the plan 1. **Straighten it.** Photos are often tilted, rotated or shot at an angle: straighten it in your head (up = the top of the drawing). Ignore the table, cups, hands and anything that is not the plan. 2. **Outline first.** Read the outer shape of the house (rectangle, L, U, notches, bays) and the total width and depth if they are written (for example 36'-0" along the top). Count the rooms. On detailed architect drawings with long dimension chains, use the overall dimensions and the room sizes; do not rebuild every small dimension. 3. **Every label.** For each room: its name exactly as written, its written size (for example 13'-0" x 14'-0" or 13' x 14' or 4.2 x 3.6), and which rooms it touches. Messy handwriting: use your best reading; if a number is unreadable, treat that room as unlabelled and say so. 4. **Walls, doors, windows.** Thick lines are walls (outer ones thicker). A gap in a wall, often with a quarter-circle arc, is a door. A wide gap with no door drawn is an open doorway. A long glass gap in an outer wall is a sliding door. Thin double lines or small ticks on an outer wall are windows; if the drawing shows none, add one or two ordinary windows per living room and bedroom and mark them estimated. 5. **Outside.** Dashed areas outside the walls are patios, porches, decks or balconies. A pool drawn on the plan or the site plan is a pool. 6. **Small spaces** (closet, CL, coat, pantry, WIC, powder room, linen, laundry) stay as their own small rooms. 7. **Open-plan spaces.** Where kitchen, dining and living share one space without a wall, there is NO wall between them. ## Sizes and units - Plan in feet and inches: `"units":"ft"`. Otherwise `"units":"m"`. The JSON geometry is ALWAYS metres (1 ft = 0.3048 m, 1 in = 0.0254 m; 13'-0" = 3.962 m, 13'-6" = 4.115 m, 22'-0" = 6.706 m). `units` only decides what the viewer SHOWS: every dimension, tag and area appears in the plan's own units. - **Written sizes always win** over how the plan is drawn. Build the outline and every labelled room from the written numbers. Scale the unlabelled rooms from the drawing, using the labelled ones as the ruler. If the drawing disagrees with a label, keep the label and adjust the unlabelled neighbours. - If an overall dimension is cut off, add up the labelled rooms along that side. If a total area is written (for example 1,936 sq ft), make the rooms add up to it and say the difference in the reply. - Nothing written at all: normal sizes (bedroom about 3.5 x 3.5 m, bathroom 2.5 x 2.3 m, living room 5 x 4.5 m, kitchen 4 x 3.5 m, hall 1.2 to 1.5 m wide, door 0.9 m, window 1.2 to 1.6 m), all marked estimated. ## The house JSON Metres. Origin = the bottom-left corner of the outline; x goes right, y goes UP the page (like a map). ``` { "name": "My House", shown in the info card; use the plan's title if it has one "units": "ft", "ft" or "m" "walls": [ {"a":[0,0], "b":[10.97,0], "t":0.22} ], "doors": [ {"x":5.2, "y":0, "w":1.0, "type":"swing"} ], "windows": [ {"x":2.0, "y":0, "w":1.4, "h":1.2, "sill":0.9} ], "rooms": [ {"name":"Living Room", "type":"living", "x":0, "y":0, "w":6.706, "d":4.877} ] } ``` - **walls:** a line from end `a` to end `b`. Outer walls first with `"t":0.22`, then every inner wall as one line from corner to corner (default `t` 0.15). Walls meet exactly at corners and T-junctions (same numbers). For an L-shaped house there are six outer walls. - **doors:** the centre point ON a wall plus width `w` (the engine snaps it to the nearest wall). `"type"`: `swing` (default), `slide` (glass sliding door, `w` 2 m or more, for doors to the patio) or `open` (doorway without a door). Interior doors 0.8 to 0.9 m, front door 1.0 m, open doorways 1.0 to 1.5 m. A door between two rooms sits on the wall they share. Every room is reachable through a door or an open doorway. - **windows:** the centre point on an OUTER wall, `w` width, `h` height (default 1.2), `sill` (default 0.9). Small bathroom windows: `w` 0.7, `h` 0.6, `sill` 1.5. - **rooms:** a rectangle (`x`,`y` = lower-left corner, `w` = width along x, `d` = depth along y), or `"poly": [[x,y], ...]` for an L-shaped room. `name` exactly as written. ALWAYS set `type`, or the room stays empty: - `living` living room, lounge, family room, great room · `kitchen` · `dining` - `bedroom` bedroom, bed 2, primary, master, guest, kids, nursery - `bath` bathroom, ensuite, ENS, WC, toilet, powder, shower room - `hall` hall, hallway, entry, foyer, corridor, mudroom (hallways are always their own hall rooms) - `office` office, study, den, library · `laundry` laundry, utility, pantry, closets, coat, WIC, linen, storage · `garage` - `terrace` patio, porch, deck, terrace, balcony (outside the walls, no walls around it) - `pool` swimming pool (its own rectangle outside the house, no walls; the engine adds water, stone edge, deck, loungers, parasol and planters) - Unsure: by size, 18 m² or more `living`, 9 m² or more `bedroom`, 4.5 m² or more `office`, smaller `laundry`. - **Open plan:** no wall between kitchen, dining and living when the plan shows none, but still one rectangle per use, sharing a boundary line; walls go only around the whole open space. When ONE label names several uses ("LIVING / DINING / KITCHEN"), split that space into one rectangle per use where the drawing shows the sofa, the table and the counters. - A closet drawn inside a bigger room: make the bigger room smaller so the two do not overlap, or leave the closet out and say so. - **furniture:** leave it OUT; the engine furnishes every room itself. Only when I ask for specific furniture, give that room a `"furniture"` list with everything it should hold: `{"t":"sofa","x":3.5,"y":1.4,"r":180}` (`x`,`y` = centre in metres; `r` 0 = back against the north wall, 180 = south wall, 90 = west wall, 270 = east wall; optional `w`, `d`, `c` colour). Types: sofa, armchair, coffee, tvunit, rug, dining, chair, counter, sink, hob, fridge, upper, island, stool, bed, nightstand, wardrobe, desk, officechair, dresser, tub, shower, basin, wc, washer, dryer, lounger, planter, outdoor, plant, bookshelf, floorlamp, sidetable, art. ## Reply (after the file) 1. Three short control lines: - Overview (key 1): drag to spin, scroll or pinch to zoom, it sways by itself. Tap a room tag to fly to that room. - Walk (key 2): WASD or arrow keys, drag to look; on a phone use the joystick. Tour (key 4) glides through every room by itself. - Plan (key 3): top-down plan with room sizes, areas and dimension lines; the Units button switches m and ft. 2. A table of EVERY room, in the plan's units: Room | Size | Area | "from the plan" or "estimated" (closets and outdoor areas included). 3. The overall size and the total indoor area, and the plan's written total with the difference, if it has one. 4. In one or two lines, what else you estimated (windows added, door positions, anything hard to read). 5. Last line, exactly: Something off? Tell me like: make the kitchen 12 by 14 feet and I'll fix it. ## Edits (when I ask for a change later in this chat) Change only that part of the JSON (a room size, a wall, a door, a window, a room type, furniture), keep everything else, adjust neighbours if they would overlap or leave a gap and say so, build again exactly as above, show the new house and the updated table. The look (wall colours, floors, sun) is fixed by the engine: never edit the engine. ## Done when - Every size written on the plan is in the JSON exactly; the rooms add up to the written total (or the difference is stated). - Every room on the plan is there, with its name and a type; no two rooms overlap; no gaps inside the outline. - Every room can be reached through a door or an open doorway; every door and window centre lies on a wall. - `house.html` is the engine byte for byte except the PLAN line (the `assert` above passed), and it is shown in the chat. - The reply has the controls, the full table, the totals and the last line. ## The code The engine. Use it verbatim; replace ONLY the line between `/*__PLAN__*/` and `/*__PLAN_END__*/`. ```html My House
```