Testing the "General Coding" Capabilities of Large Language Models: From Code Generation to 3D Scene Construction
Large language models are pushing code generation beyond traditional web development into 3D scene construction. This hands-on test uses a 450㎡ commercial space reconstruction task to evaluate spatial reasoning, visual self-checking, and modular code generation—and shares practical engineering lessons developers can reuse.
What Is “General Coding”: From Writing Code to Expressing the World Through Code
In the past, we evaluated a model’s programming ability mainly by whether it could build web pages, patch APIs, or fix bugs. But in this round of model iteration, one clear trend stands out: the expressive boundaries of code have been dramatically widened.
“General coding” can be summarized in three layers:
- Visual input layer: The model can understand what it sees, interpreting spatial relationships and visual details in screenshots, design mockups, and video frames.
- Code expression layer: The geometric structure, materials and textures, lighting, physics rules, and interaction logic of a 3D scene can all be described and generated through code.
- Self-check feedback loop: During generation, the model proactively calls tools such as preview and screenshot utilities, feeding its own “run results” back to itself and forming an iterative loop of “write—run—review—fix”.
With these three layers combined, the model’s applicable scenarios extend from traditional web development to more complex domains such as spatial construction, interactive creation, and digital twins. For developers, this means workflows that once required modeling software, design tools, and frontend frameworks working in collaboration may be replaced by a single pipeline: natural language → code → runnable output.
Test Design: 3D Reconstruction of a 450㎡ Commercial Space
To validate these capabilities, I designed a task with strict constraints: given a 450㎡ unfinished commercial space (modeled on a restaurant), the model was asked to build a complete, explorable 3D scene from scratch using Three.js.
The difficulty here is not “generating a piece of Three.js code”, but stacking multiple spatial constraints:
- Fixed constraints: Load-bearing columns, doors and windows, and main circulation paths must stay exactly where they are; any offset invalidates the design.
- Layout constraints: The spatial relationships among the storefront, main hall, private rooms, and dining tables must be coordinated.
- State-switching constraints: The same camera view must support toggling between “unfinished / finished” states; even slight coordinate or scale errors will cause visible glitches during switching.
- Visual detail constraints: Close-up details such as pot dividers, cup walls, and broth colors are hard to get right purely through code logic and must rely on visual feedback.
In effect, this is a combined stress test of three capabilities: spatial reasoning, code generation, and visual self-checking.
How the Model Completed the Task
Modular Decomposition of the Space
After receiving the task, the model first decomposed the scene into independent modules: the building shell (walls, doors, windows, load-bearing columns), the storefront facade, the main hall seating area, the private rooms, and the dining table props. Each module was wrapped in its own function to make state switching easier later:
function buildHall(mode) {// mode: 'rough' | 'decorated'const group = new THREE.Group();// Load-bearing columns and main path share identical// coordinates in both modesloadBearColumns(group);if (mode === 'decorated') {addTablesAndSeats(group);addLighting(group);}return group;}
This modular organization guarantees zero displacement of shared structures when switching between “unfinished / finished”—a key engineering technique for consistency in multi-state scenes.
The Visual Self-Check Loop
What is even more notable is the self-checking behavior. During the build, the model proactively called the preview tool to take screenshots for inspection, and corrected two types of problems that are very hard to spot by reading code alone:
- A wooden lattice decoration was blocking a private-room doorway, obstructing the circulation path;
- The divider inside a hot pot was misaligned with the red and white broths—a visual semantic error.
These cases show that code correctness alone cannot guarantee scene correctness. Feeding rendered results back to the model for visual judgment is the core mechanism that makes this kind of task work at all. In your own workflows, you should build “screenshot feedback” into your Agent’s loop rather than generating everything in one shot.
Verification: Camera-by-Camera Inspection
The final deliverable was a web page supporting multiple camera views and free drag navigation. For verification, I fixed the camera and checked the scene segment by segment:
- Storefront view: The signage, entrance porch, and interior depth behind the glass blended naturally—at first glance it looked like a real restaurant.
- Main hall view: The four load-bearing columns and the 2.6-meter main path stayed perfectly fixed across both states, with tables and chairs laid out along both sides, giving the space a stable order.
- Private room view: Doorways, lattices, and circulation paths aligned correctly; you could see the dining tables inside directly from the entrance, with no “looks right from afar, falls apart up close” patchwork feel.
- Table close-up: The hot pot divided red and white broth along the divider, and the teacups had visible wall thickness—details that directly demonstrate the value of visual capability.
Reusable Lessons for Developers
Based on this test, here are a few practical recommendations:
- Put constraints up front: Explicitly list fixed constraints (coordinates, dimensions, circulation paths) in the prompt, and require the model to output a layout plan before writing code. This significantly reduces rework.
- Enforce a self-check loop: Design an iterate-and-refine step into your Agent pipeline—“render → screenshot → visual review → fix”. Two or three rounds are usually enough to eliminate most visible glitches.
- Deliver in modules: Ask the model to split generated code by functional module. This makes state switching easier and leaves room for manual fine-tuning.
- Verify in layers: Check global spatial relationships first, then inspect details camera by camera, so local errors don’t get hidden by the overall effect.
Final Thoughts
“General coding” represents a paradigm expansion of code generation: when a model combines visual understanding, spatial reasoning, and self-verification, code evolves from a tool for implementing logic into a medium for expressing the world. For developers, now is a good time to bring these capabilities into technology evaluations—start with a space reconstruction or an interactive prototype, and see how far they can go in your own business scenarios. With this generation of capabilities now moving into real-world applications, the pace of adoption is worth watching closely, and I look forward to seeing more engineering practices spark new ways to use them.
