Testing 3D Code Generation in Chinese Large Language Models: Evaluation, Prompting, and Production Readiness
This article examines how well Chinese large language models generate runnable 3D code, using a single interactive Three.js-style scene as the test case. It explains why open-ended 3D page generation is a tougher benchmark than algorithm problems or CRUD endpoints, then lays out a six-dimension evaluation framework covering runnability, structural clarity, visual completeness, detail density, interaction stability, and iteration convergence. Practical observations from prompts such as a pelican riding a bike along a coastal road and an erupting volcano show where leading outputs pull ahead. The article also provides a reusable prompt template, engineering guidance for performance and resource management, observability, and quality gates, plus a three-round selection workflow for assessing models.
1. Why “Generate a 3D Page” Is the Hardest Test
When people evaluate a model’s coding ability, they usually reach for algorithm problems, CRUD endpoints, or scripting utilities. These tasks have well-defined inputs and outputs and a single correct answer, so a model scores points as long as the syntax is valid. But the hardest part of real engineering is rarely syntax. It is producing a usable structure and a sense of aesthetics under an open-ended requirement.
Asking a model to output a standalone, interactive 3D page stacks three kinds of difficulty on top of each other:
- Extremely vague requirements: a single natural-language description, with no interface contract and no data structure, so the model has to decompose the requirement itself.
- Composite capabilities: it needs a scene graph structure, geometry and materials, lighting and shadows, camera and controls, an animation loop, and resource lifecycle management, all at once.
- Directly perceivable results: whether the scene looks good, whether you can zoom in, and whether the interaction feels smooth are all obvious at a glance, leaving almost no room to hide behind wording.
So this kind of task does not measure “can it write code.” It measures whether the model can translate an aesthetic intent into a sound engineering structure. That is also why it sits closer to production than traditional benchmarks.
2. Evaluation Design: Turning Subjective Impressions into a Repeatable Process
For conclusions to hold up, the first step is converting “I think it looks good” into observable metrics. Cover at least these dimensions:
- Runnability: does the single file open directly, is the console free of errors, are any dependencies missing.
- Structural clarity: is the code split into clearly scoped functions such as initialization, resource construction, interaction binding, and the render loop, rather than several hundred stacked lines.
- Visual completeness: does the composition have a clear focal hierarchy, are the colors consistent, do materials differentiate roughness and metalness instead of looking uniformly plastic.
- Detail density: do the far, middle, and near ground all contain content, and are empty areas accounted for.
- Interaction stability: do dragging, zooming, and rotating track the input, and are there jitter, clipping, or camera pass-through issues.
- Iteration convergence: after several rounds of added requirements, does it keep getting better, or does it keep introducing new problems.
The sixth point is the easiest to overlook and the most revealing about real collaboration cost. A model that dazzles in round one and breaks in round two is a liability once it lands in a project.
3. Hands-On Observations: The Line Between “It Runs” and “It Looks Good”
On a classic prompt like “generate a 3D scene of a pelican riding a bike,” most models deliver a runnable version: a bird, a vehicle, a ground plane. The gap shows up on the second look.
The stronger outputs tend to share a few traits. First, they fill in the scene narrative on their own: beyond the subject, they add a winding coastal road, road signs, palms, and wild grass, so the image has environmental logic. Second, lighting follows a single direction: warm low-angle light runs through the whole scene, shadows point the same way, and the contact area between subject and ground has a plausible light-to-dark transition instead of every object lit independently. Third, the distance is not empty: distant island silhouettes, a lighthouse, circling birds, and even the outline of something leaping in the water cost very little but contribute a great deal to depth. Fourth, the water is handled well: normal perturbation, Fresnel-style edge brightening, and layered specular reflection get close to a high visual standard without introducing any external textures.
On a reserved prompt like “volcanic eruption,” the focus shifts to process simulation: the particle system has to respect a lifecycle, eruption intensity needs a rise-and-fall curve, lava flow needs directionality and a cooling gradient, smoke and firelight need layering, and the camera has to sustain long runs without dropping frames. What matters here is not how flashy the effects are, but whether the parameters form a coherent, adjustable system.
Note that the observations above come from a single hands-on session and are subjective impressions. They are not a quantitative performance ranking, and both the prompt and randomness can significantly affect results.
4. Prompt Engineering: The Variable That Sets the Ceiling
With the same model, prompt quality alone can shift the output by a full tier. A reusable structure:
Goal: a single HTML file, runnable by double-clicking, no external resource references.Scene: a coastal highway at dusk, subject is a cycling pelican, style leaning toward indie animated film.Technical requirements:1. Use a general-purpose 3D rendering approach, split responsibilities into init / buildScene / bindControls / animate;2. Single primary light direction, soft shadows, materials differentiating metalness and roughness;3. Water uses procedural normal perturbation + specular reflection, no textures;4. Camera supports free orbit, clamp pitch and zoom range, avoid going underground;5. Render loop uses delta time to keep motion consistent across frame rates.Acceptance: no console errors; no continuous memory growth over 5 minutes of running.
The key is turning aesthetic words into executable constraints. “Make it premium” means nothing. “Single primary light direction, materials differentiating roughness, the distance must contain content” can be executed reliably.
5. Engineering It: From Demo to Maintainable
A demo that runs is still three steps away from shipping.
Performance and resource governance. Reuse geometry where possible, share materials, keep texture sizes bounded; merge draw batches for objects that do not participate in interaction; avoid creating new objects every frame in the animation loop to prevent garbage-collection stutter.
let last = performance.now();function animate(now) {const dt = Math.min((now - last) / 1000, 0.05); // prevent jumps after tab is backgroundedlast = now;update(dt);renderer.render(scene, camera);requestAnimationFrame(animate);}
Observability. Wire in a logging service to record frame rate, draw calls, and exception stacks; use monitoring alerts with thresholds on error rate and response latency; put static assets in object storage behind a content delivery network to cut first-paint waiting.
Quality gates. Write “zero console errors, interactive, stable over long runs” as automated checks in continuous integration, and run them on every model output to avoid regressions during iteration.
6. Selection Advice and Conclusion
To assess a model’s 3D code ability, do not judge by a single screenshot. Run three rounds of iteration + six-dimension scoring + automated gates: round one checks completeness, round two adds detail constraints to test convergence, round three asks for a refactor to see whether the structure stays controllable.
The conclusion is clear: Chinese large language models have entered a usable range for complex visual and interactive code generation, and can take on prototyping, visualization demos, and teaching material. What really decides whether a project succeeds is still prompt design, acceptance criteria, and engineering governance. Baidu AI Cloud provides full support across common capabilities such as model services, container platforms, and logging and monitoring, which can help teams embed this kind of capability stably into the development workflow.
