How to Benchmark Multiple LLMs on Three.js Scene Generation: Methods and Practices
This article presents a neutral, reproducible method for comparing multiple large language models on natural-language generation of runnable Three.js web scenes. It explains how to control variables such as prompts, agent scaffolding, runtime environment, resource policies, and timing, then applies the method to two tasks: a disassemblable mechanical firefly and a working container crane at a port terminal. It summarizes typical model trade-offs, provides a four-dimension scoring rubric with a sample JSON table, and shows an automated acceptance script using a headless browser to capture errors, failed requests, frame rate, and interactive parts. The conclusion focuses on matching models to scenarios rather than ranking them, along with engineering recommendations for CI regression, explicit performance and accessibility requirements, and centralized hosting with logging and monitoring.
1. Background: Why “Generating a 3D Scene from One Sentence” Deserves a Serious Benchmark
Generating a runnable 3D web page directly from natural language has become a high-difficulty test of an AI coding tool’s overall capability. It stresses four areas at once: accurate knowledge of the 3D engine API; self-consistent physical structure and motion logic; mature visual design and interaction details; and sound engineering quality in the delivered code, including resource disposal, exception handling, and accessibility.
The original material took several popular AI coding tools, ran them on 6 tasks with the same prompt and the same agent, and compared task quality and task efficiency. That approach is worth reusing, but it needs to be made neutral. This article does not revolve around any specific product. Instead, it abstracts the topic into a “method for benchmarking multiple models on 3D web page generation,” using industry-neutral terms for the systems under test, such as “Model A/B/C,” “a certain AI coding tool,” or “a model service from a cloud vendor.”
The value of the benchmark is not a ranking of “who is the strongest.” It is breaking a vague “feels pretty good” into quantifiable, reproducible metrics so that teams have a solid basis for model selection.
2. Benchmark Design: Controlling Variables Is a Prerequisite for Trustworthy Conclusions
To make the comparison meaningful, lock down the variables first. Fix the following five items:
- Use exactly the same prompt, with no wording tweaks tailored to any single model;
- Use the same agent scaffolding, including file structure, dependency versions, and build method;
- Use the same runtime environment, with unified browser version, viewport size, and device pixel ratio;
- Use the same network and resource policy, declaring in advance whether external resource loading is allowed;
- Use the same timing convention, measured from prompt submission until the output renders correctly.
Only when variables are controlled do the later comparisons of “task quality” and “task efficiency” hold. Otherwise, differences in scaffolding are easily mistaken for differences in model capability.
3. Task 1: Testing Fault Tolerance with a Disassemblable 3D Mechanical Device
The first task uses a “wish-style” one-sentence prompt: build a disassemblable mechanical firefly with a 3D engine. Such a task looks simple but is dense with traps.
In the benchmark, all three outputs ran normally, with no script errors and no resource loading failures. The disassembly interaction genuinely worked; there was no fake implementation that “looks 3D but cannot be taken apart.” This shows that mainstream models have already passed the basic runnability bar, and differences appear at the detail level.
Three typical orientations emerged:
- Structure-maximalist: disassembly is implemented at high density, with more than thirty independent parts. The thorax is split into upper and lower shells with a seam ring; inside are a drive gear, a secondary gear, a transmission shaft, and energy-conducting tubes. The abdomen has multiple segments that move back one by one, and after disassembly the parts can be expanded in staggered order by index. The weakness is that the default camera is too far away, and the opening animation assembles from a fully exploded state, which can be mistaken for a program error.
- Narrative-professional: it uses a museum-specimen style of expression. When disassembly progress passes a threshold, part annotation lines appear and are projected in real time for positioning. It adds elytra structure consistent with biological classification. It provides three responsive layouts, fairly complete accessibility annotations, adaptation to reduced-motion preferences, deterministic randomness, and rendering resource disposal. The weakness is coarse disassembly granularity: only a few large parts are separated, and multiple legs are merged into a single part.
- Recognizability-first: its color scheme and shape look most like a firefly, with a retro feel of cold light paired with brass. The wings use Bézier surfaces with wing veins, and all four wings and six legs are present. The weaknesses are three hard defects: gears and side panels clip through each other, default exposure is too low, and the UI has only two buttons with no loading state.
As for time, the three took about 7 minutes, 9 minutes, and 32 minutes respectively. Note that longer time does not mean higher quality; it may also come from repeated trial and error and self-repair. When evaluating, record “first-pass success rate” and “number of repair rounds” separately.
4. Task 2: A 3D Animation Scene with Reasonable Physical Structure
The second task is harder: create a container crane at a port terminal that operates properly. It puts more pressure on physical structure design and web aesthetics. Common failure points include: non-conservative relative motion between the spreader and the container; a mismatch between wire rope length and hoisting logic; missing limits that cause clipping; and unreasonable track and yard layout.
The score can be split into four groups, each with clear criteria:
- Functional correctness: whether each joint has the full degrees of freedom, whether motion is closed-loop, and whether there is clipping or jitter;
- Code quality: module separation, naming, comments, resource disposal, and exception handling;
- Visuals and aesthetics: composition, materials, lighting, color hierarchy, and information density;
- Engineering completeness: responsiveness, accessibility, reduced-motion adaptation, loading states, and error messages.
A sample scoring table can be maintained as structured data for easy comparison:
{"task": "port_crane","models": {"A": {"function": 8, "code": 7, "visual": 6, "engineering": 5, "minutes": 7},"B": {"function": 7, "code": 9, "visual": 9, "engineering": 9, "minutes": 9},"C": {"function": 6, "code": 6, "visual": 8, "engineering": 4, "minutes": 32}}}
5. A Reproducible Automated Acceptance Script
Manual visual inspection does not scale. Add an automated acceptance layer. The core idea is to load the output in a headless browser, capture script exceptions and resource failures, and then assert on key interactions.
// Pseudocode: unified acceptance flowconst errors = [];page.on('pageerror', e => errors.push(String(e)));page.on('requestfailed', r => errors.push('RES_FAIL ' + r.url()));await page.goto(url, { waitUntil: 'networkidle' });await page.waitForSelector('canvas');const fps = await sampleFps(page, 3000); // sample frame rateawait clickAndDrag(page, '#explode', 200); // trigger disassemblyconst parts = await countSceneChildren(page); // count movable partsconsole.log({ errors, fps, parts });
The value of this script is turning “zero errors, zero resource failures, and genuinely effective interaction” from a subjective judgment into regression assertions. After a model iteration, you can run the historical task set directly.
6. Conclusions and Selection Recommendations
The point of the benchmark is not a ranking but matching the scenario. If you pursue structural density and disassembly detail, lean toward the structure-maximalist type. If you value professional narrative and engineering completeness in the deliverable, lean toward the narrative-professional type. If you care more about shape recognizability and fast drafts, you can accept a certain proportion of visual defects, but clipping, exposure, and loading states must be on the must-fix list.
There are also three general engineering recommendations: first, incorporate 3D generation tasks into continuous integration and regress them with a unified script; second, explicitly state performance budgets and accessibility requirements in the prompt to reduce rework; third, host outputs centrally in object storage with logging services and monitoring alerts to make online issue diagnosis easier. If you use a container platform to host the build and preview environments, it can significantly improve the stability of parallel multi-task evaluation.
