How Multimodal Coding Models Handle 3D Spatial Design: A Hotpot Restaurant Case Study
As multimodal AI evolves, coding models are extending beyond web pages and scripts into 3D spaces and interactive scenes. This article uses a real project—converting a ~450-square-meter empty restaurant space into a browsable 3D hotpot restaurant—to examine how multimodal coding models approach spatial modeling. It covers why 3D generation is harder than page generation, how to translate visual objects into executable structures, a complete workflow from spatial planning to 3D generation, visual feedback loops, before/after state switching, interaction design, common pitfalls, and practical takeaways for developers.
With the rise of multimodal AI, the application boundaries of coding models are expanding from web pages, APIs, and scripts into 3D spaces, interactive scenes, and dynamic content creation. In the past, developers typically had to complete the spatial design first, and then modelers, front-end engineers, and interaction developers handled geometry, materials, camera control, and interaction logic separately. Today, coding models with visual understanding can try to unify this work into a single “describe—generate—observe—revise” loop.
This article uses the example of converting a roughly 450-square-meter bare restaurant space into a browsable 3D hotpot restaurant, analyzing how multimodal coding models actually work on spatial modeling tasks.
1. Why This Task Is Harder Than Ordinary Web Page Generation
For a static page, a model only needs to handle document structure, layout styling, and a small amount of interaction logic. But 3D spatial modeling involves geometry, proportions, materials, cameras, and circulation paths simultaneously—any error in one dimension affects the final result.
The first class of constraints comes from the building structure. Load-bearing columns, doors, windows, walls, and main corridors usually cannot be moved. The model must not just “generate a scene that looks like a restaurant”—it must keep these fixed structures consistent before and after renovation.
The second class comes from functional layout. The main hall, private dining rooms, cashier area, waiting area, and dining zones must form a coherent spatial relationship. Tables and chairs cannot block main corridors, private room entrances cannot be hidden behind decorations, and clear circulation between the front of house and the back of house must be preserved.
The third class comes from visual consistency. Users want to compare the “bare shell state” and the “renovated state” from the same viewpoint. This means both states must share the same coordinate system, camera parameters, and building boundaries—otherwise switching causes misaligned columns, drifting walls, or furniture clipping through walls.
The fourth class comes from interaction requirements. The scene cannot just be a static render; it should support rotation, zooming, panning, view switching, and renovation state toggling. The model must generate spatial data, rendering logic, and interaction logic together.
In essence, this task is not simple code completion—it is a small-scale spatial digitization project.
2. The Core of “Generalized Programming”: Turning Visual Objects into Executable Structures
“Generalized programming” can be understood as converting content originally expressed through images, videos, 3D scenes, or interaction rules into executable program structures.
Take the hotpot restaurant as an example. The model needs to break a natural-language description into a set of programmatically manageable objects:
Space├── Building boundaries├── Fixed structures│ ├── Load-bearing columns│ ├── Doors and windows│ └── Main corridors├── Functional zones│ ├── Storefront│ ├── Main hall│ ├── Private rooms│ └── Service areas├── Decorative objects│ ├── Wall finishes│ ├── Ceiling│ ├── Lighting fixtures│ └── Wooden partitions└── Interaction states├── Bare-shell state└── Renovated state
This decomposition is critical. If everything is piled together as scattered geometry, later modifications easily cause cascading problems. A better approach is to build a scene tree first, then split it into functional modules, so each module has clearly defined position, size, material, and visibility state.
For example, fixed structures can be defined as immutable objects:
const fixedStructure = {columns: [],doors: [],windows: [],corridors: []};
The renovation parts can be independent layers:
const decorationLayer = {wallFinish: [],ceiling: [],furniture: [],lighting: []};
This way, switching between the bare-shell and renovated states doesn’t require recomputing the whole scene—just toggling the visibility of the corresponding layers. This design makes interaction easier and reduces the risk of coordinate drift and state confusion.
3. The Complete Workflow: From Spatial Planning to 3D Generation
1. Establish measurement and coordinate conventions first
The most common failure in 3D scenes is inconsistent units across objects. If walls are measured in centimeters while furniture is in meters, the proportions will be badly distorted.
Before generating anything, define these rules:
- Unify the length unit;
- Specify the ground height and vertical axis;
- Set the space origin;
- Fix the main entrance direction;
- Agree on camera height and viewing direction;
- Create an immutable list of fixed structures.
For a rectangular site, you can start with a basic boundary:
const space = {width: 25,depth: 18,height: 3.2,entrance: { x: 0, z: -9 }};
These values are illustrative; real projects should use measured data. The key point is not the numbers, but that all objects depend on the same coordinate system.
2. Perform functional zoning
Spatial zoning should not only pursue visual effects but also consider how people walk. Main corridors should be continuous, tables need enough clearance from walls, and private room entrances should avoid conflicts with service paths.
An executable zoning description might read:
Entrance zone: storefront display and customer entryFront hall: waiting, greeting, and checkoutMain hall: primary dining tablesBack zone: relatively independent private roomsCirculation zone: connects entrance, main hall, private rooms, and service points
When generating code, having the model output a 2D floor plan first and then 3D objects is usually more stable than generating a complete 3D scene directly, because 2D layouts make it easier to check boundaries, spacing, and connectivity.
3. Generate geometry by module
After the layout is done, generate walls, floors, tables, partitions, and decorations for each zone. Prefer parametric components over large amounts of hand-written, repetitive code for each object.
For example, abstract reusable furniture functions:
function createTable(position, size, material) {// Create tabletop, legs, and material}function createPartition(position, width, height, material) {// Create the partition structure}
The benefit of parametric modeling is that adjusting table sizes, spacing, or partition heights later only requires changing parameters, not editing each object individually.
4. The Value of Visual Capability in Quality Control
Checking a 3D scene through code alone is difficult. Code can tell you an object’s coordinates, but not whether it blocks a door, intersects a wall, or looks natural from the user’s viewpoint.
Visual feedback is therefore a critical part of the workflow.
A reasonably complete iteration loop looks like this:
- The model generates the first version of the scene code;
- A rendering tool outputs multiple fixed viewpoints;
- The model analyzes structural issues in the screenshots;
- It locates the relevant objects and parameters;
- It revises the code and re-renders;
- It compares before and after results;
- Once passed, it adds details and interactions.
Fixed viewpoints are especially important. At minimum, set up these observation positions:
- Street-facing entrance view;
- Main hall center view;
- Main corridor view;
- Private room entrance view;
- Close-up table view;
- Top-down layout view.
Different viewpoints catch different problems. The entrance view is good for checking the storefront and depth; the hall view validates circulation and table layout; close-ups expose problems with pots, cups, materials, and proportions.
5. Implementing Bare-Shell vs. Renovated States
The before/after comparison is one of the most valuable features in this kind of scene, but it cannot be implemented by simply deleting the bare-shell objects and creating a new scene. That easily leads to inconsistent coordinates between the two scenes.
A more robust approach uses shared structures and state layers:
const sceneState = {mode: 'unfinished'};function switchMode(mode) {sceneState.mode = mode;unfinishedLayer.visible = mode === 'unfinished';finishedLayer.visible = mode === 'finished';}
Here, load-bearing columns, doors, windows, building boundaries, and main corridors are shared structures that stay visible at all times; wall finishes, furniture, lighting, and soft furnishings belong to renovation layers toggled by state.
For more complex effects, the state can be designed as multiple phases, for example:
Bare shellBasic constructionHard finishes completeSoft furnishing completeOperational state
This layered approach applies not only to restaurants but also to exhibition halls, residential spaces, office areas, and retail storefronts.
6. Interaction Design Cannot Be Ignored
Whether a 3D scene is “usable” depends not only on the visuals but also on whether users can quickly understand and operate it.
Provide at least these interactions:
- Mouse drag to rotate;
- Scroll wheel to zoom;
- Pan to move around;
- Preset camera switching;
- Bare-shell/renovated state toggle;
- Quick navigation to key areas;
- Reset to the default view.
In implementation, prevent the camera from passing through walls or going below the floor. You can improve browsing stability by constraining camera distance, pitch angle, and target range.
Mobile devices also need touch support. Pinch-to-zoom, one-finger rotation, and two-finger panning should all be explicitly mapped; otherwise users easily get lost.
7. Common Problems and Improvement Strategies
1. Visually appealing, but spatially inaccurate
This is the most common problem in generative modeling. The fix is to lock the overall boundaries and fixed structures first, then gradually add furniture and decoration—do not chase details from the start.
2. Objects intersecting each other
Clipping usually happens because object dimensions are not part of the layout calculation. When generating tables and chairs, treat width, depth, and safety clearance as parameters rather than placing things by visual feel.
3. Inconsistent camera position after switching views
All states must reuse the same camera parameters. Cameras should be treated as independent configuration, not generated dynamically along with scene objects.
4. Code growing too long to maintain
Split modules early: separate space, materials, lighting, furniture, interaction, and state management. For repeated objects, prefer components and configuration-driven data over copy-pasted code.
5. Rich detail but slow loading
The number of models, materials, and texture resolutions all affect performance. Real projects should adopt layered loading, object reuse, simplified geometry, and on-demand display. Distant objects can use low-poly models, with details shown only when the camera gets close.
8. Takeaways for Developers
This kind of practice shows that the value of multimodal coding models is not just “helping people write code”—they are beginning to participate in the entire software construction process:
- Converting natural-language requirements into structured tasks;
- Converting images and spatial relationships into program objects;
- Performing visual inspection through rendered results;
- Automatically revising the implementation based on feedback;
- Delivering a runnable, interactive application.
This does not mean developers can abandon engineering judgment. Models excel at rapid generation and iteration, while developers remain responsible for defining constraints, validating data, optimizing performance, handling exceptions, and final acceptance.
A more reliable collaboration model treats the model as an engineering assistant with visual feedback, not a one-shot generator. Define spatial rules first, then generate; validate structure first, then refine details; build maintainable modules first, then add visual polish. Only then can 3D generation move from “looks right” to “structurally sound, interactively usable, and continuously modifiable.”
Overall, multimodal coding is driving a shift in the development paradigm. Future spatial design, digital showrooms, storefront displays, and interactive prototypes may no longer need to be built by hand from scratch, but generated through programs driven by natural language, reference images, and structured constraints. What ultimately determines the outcome will not just be a model’s coding ability, but whether it can understand space, respect constraints, and continuously correct itself through visual feedback.
