Comparing 3D Code Generation Across Multiple Models
This article presents a multi-model comparison of 3D code generation, using interactive 3D scenes as a test of a model’s engineering capability. It explains the evaluation design, including controlled variables, a six-category task matrix, and scoring criteria for quality and efficiency. Two core subjects are covered in detail: disassemblable mechanical structures and physics-based crane animations, with typical capability profiles, common failure points, and timing differences. The article also offers a reproducible scoring checklist and practical selection advice for engineering teams.
一、Why 3D Code Generation Tests a Model’s Engineering Capability
As AI coding tools move into the agentic stage, evaluation has shifted from “can it write a function?” to “can it independently deliver a runnable, interactive, and shippable front-end project?” Interactive 3D pages are one of the toughest testbeds: they demand mathematical and geometric intuition, scene organization, understanding of the rendering pipeline, event and state management, and a realistic grasp of the browser runtime.
A wish-style natural-language prompt—for example, “use a 3D rendering library to build a mechanical firefly that can be taken apart”—looks simple but hides many implicit constraints: coordinate systems and orientation, parent-child hierarchies and pivot points, matching materials and lighting, interpolation curves for the disassembly animation, mobile adaptation, and fallback strategies for load failures. A model trained mainly on 2D pages often produces pseudo-interactions that “look 3D but cannot actually be disassembled.” Therefore, we use 3D scene generation as the core subject of the horizontal comparison.
Note that this article does not evaluate any specific vendor product. Instead, it abstracts the results of three models into three typical capability profiles to explain the evaluation method and criteria.
二、Evaluation Design: Controlling Variables Matters More Than Piling Up Tasks
For a horizontal comparison to yield meaningful conclusions, variables must be locked down first. Our setup is as follows:
- Same prompt: each task gives only a one-sentence requirement, with no added style constraints, to examine the model’s default aesthetics and default engineering habits.
- Same agent scaffold: identical file structure, identical dependency versions, and identical build and preview flows, to avoid toolchain differences contaminating the results.
- Same runtime environment: two viewports, desktop and mobile, with console error capture and resource-loading monitoring enabled uniformly.
- Six-category task matrix: static 3D display, disassemblable mechanical structure, physics-based motion animation, data visualization scene, interactive mini-game, and complex materials with post-processing.
The scoring dimensions are divided into two groups. The quality group includes geometric correctness (clipping, floating parts, or proportion errors), interaction completeness (whether disassembly, reset, and view switching actually work), accessibility and fallback (semantic labels, motion preferences, deterministic randomness, and resource disposal), and visual completeness (composition, color, lighting, and exposure). The efficiency group only records end-to-end task time and the number of manual rework rounds, because the “first-pass rate” reflects real cost better than generation speed.
三、Subject One: Disassemblable Mechanical Structures
All three profiles delivered artifacts that ran without errors, with real and effective disassembly logic—already above the passing line. The differences appear in engineering depth.
The first profile pushes “disassemblable” to the extreme: more than thirty independent parts, a thorax made of upper and lower shells and a seam ring, and internal components including a drive wheel, a secondary gear, a transmission shaft, and an energy-conducting structure; the abdomen shifts backward section by section, forming a continuous accordion-like expansion; and it supports staggered animation by index. Its weakness is that the default camera distance is too far, and the opening uses a reverse narrative of “fully disassembled to assembled,” which can be mistaken for a malfunction.
The second profile is best in professional narrative and accessibility: after the disassembly progress exceeds a threshold, part annotation lines appear and project positions in real time; it includes the elytron structure, a detail consistent with biological taxonomy; and it provides three responsive layouts, extensive semantic labels, motion-preference adaptation, deterministic randomness, and rendering-resource disposal. Its weakness is coarse disassembly granularity—only nine main parts, with multiple legs merged into a single part.
The third profile is the most distinctive: a retro-industrial palette of cool self-illumination with brass, wing membranes made of Bézier surfaces with wing ribs, and complete four wings and six legs. But it has three typical defects: clipping between gears and side panels, low default exposure, and too few interactive controls with no loading state.
In terms of time, the three took about seven minutes, nine minutes, and thirty-two minutes respectively. This gap shows that finer part decomposition and more complex hierarchical animation bring super-linear time overhead, and the model makes an implicit trade-off between “structural refinement” and “delivery time.”
四、Subject Two: Physics-Based Motion and Mechanical Animation
The second subject asks for a container crane that runs properly on a port dock, focusing on physical structure design and scene aesthetics. The criteria for such tasks are very clear:
- Whether the motion chain is closed. Whether the spreader’s lift, the trolley’s traverse, the gantry’s travel, and the hoist rope’s winding share the same state source, avoiding each animation running on its own.
- Whether the constraints are reasonable. The rope length should change in real time with the spreader height, rather than being approximated with a texture; the container sway should have damping, rather than infinite equal-amplitude oscillation.
- Whether the scene has environmental narrative. Ground markings, yard layout, distant occlusion, and fog effects determine whether the image is believable.
- Whether there is performance-budget awareness. Instancing repeated components, limiting shadow map size, and pausing the render loop on invisible frames.
In engineering terms, the basic skeleton of state-driven behavior and resource disposal can be expressed with the following pseudocode:
// A single state source drives multiple components to avoid conflicting animationsconst state = { trolleyX: 0, hoistY: 12, sway: 0 };function tick(dt) {state.trolleyX = clamp(state.trolleyX + input.x * dt, -18, 18);state.hoistY = clamp(state.hoistY + input.y * dt, 2, 20);// Damped sway to simulate spreader inertiastate.sway += (-state.sway * 0.9) * dt;crane.update(state);rope.update(state.hoistY, state.sway);}// Dispose of GPU resources when the scene unloads; essential for long-lived pagesfunction dispose(scene) {scene.traverse(o => {o.geometry?.dispose();for (const m of [].concat(o.material ?? [])) {m.map?.dispose(); m.dispose();}});}
Common point losses in evaluation concentrate in three areas: geometric clipping, insufficient default lighting and exposure, and missing interaction and state feedback. They correspond to three root causes—lack of collision and spacing checks, lack of physically based lighting and tone-mapping configuration, and lack of interface design for loading and error states.
五、Turning Subjective Impressions into Reproducible Criteria
To make the comparison reproducible, it is recommended to fix the scoring sheet as follows:
- Runtime health: number of console errors and resource-load failures, which must be one hundred and zero.
- Interaction authenticity: every button and gesture must produce an observable state change; decorative controls are prohibited.
- Geometry check: sample contact surfaces and motion envelopes, and record the number of clipping cases.
- Visual check: use histograms to judge whether exposure is too dark, and whether the number of primary colors and contrast meet the standard.
- Accessibility: semantic-label coverage, motion-preference adaptation, and keyboard reachability.
- Efficiency metrics: end-to-end time, number of manual rework rounds, and spot checks of code readability.
The value of these criteria is that they turn “I think this one looks better” into discussable, regression-testable numbers, and make longitudinal comparison after model iterations easier.
六、Selection Advice and Practical Conclusions
There is no absolute winner among the three profiles—only scenario fit. When pursuing structural refinement and disassembly narrative, longer time is acceptable; when pursuing professional annotation and accessibility compliance, prefer the solution with complete accessibility; when pursuing visual distinctiveness and fast drafts, reserve a rework budget for fixing clipping and exposure.
For engineering teams, the practical advice is to incorporate 3D generation into a unified pipeline, with container platforms for isolated builds, object storage for hosting static artifacts, logging services for collecting front-end errors, and monitoring alerts for tracking failure rates; also keep a manual review gate, focusing on the two high-frequency defect categories of geometry and lighting. If an enterprise has already built its R&D chain in a cloud environment such as Baidu AI Cloud, it can turn the evaluation scripts and scoring sheet into an internal benchmark, enabling automatic regression when models are upgraded and moving selection from experience-based judgment to data-driven decisions.
