From Code to 3D Scenes: A Practical Framework for Evaluating Generative Models
This article presents a structured methodology for evaluating generative models on 3D scene development tasks, moving beyond code completion to delivering runnable, interactive scenes. Using two benchmark tasks—a bird character riding a bicycle along a coastal road and a volcanic eruption visualization—it covers translating natural language requirements into acceptance criteria, procedural modeling, animation timing, layered particle systems, reproducible evaluation workflows, and the engineering considerations needed to turn demo code into production-ready delivery.
1. From “Generating Code” to “Delivering a Runnable Scene”
The value of generative models in software development is expanding from function completion and error explanation to building applications with visual presentation and interactive capabilities. Taking a natural-language requirement and producing a 3D scene that runs in the browser is a prime example of this shift.
However, an impressive picture does not equal engineering reliability. A demo may look fine from the default camera angle yet exhibit model intersections once the camera rotates. Screenshots may be beautiful, but the application might suffer frame-rate drops, memory growth during sustained operation, or fail to load on another device.
Therefore, evaluation of this capability should be broken into several interrelated layers:
- Requirement understanding: Whether the model correctly identifies the main subjects, environment, motion relationships, and delivery constraints.
- Scene construction: Whether it establishes a reasonable geometric structure, materials, lighting, and spatial hierarchy.
- Dynamic expression: Whether character motion, particle movement, and environmental changes are coordinated.
- Interaction usability: Whether camera controls, pause/resume, and window resizing work correctly.
- Engineering delivery: Whether dependencies are explicit, the code is maintainable, and the runtime conditions are reproducible.
This article uses two general-purpose tasks for analysis: building a scene of a bird character riding a bicycle along a coastal road, and creating a 3D visualization of a volcanic eruption. They focus on character animation and dynamic effects respectively, covering a broad range of development capabilities.
Note that what follows is an evaluation and implementation methodology—not a benchmark ranking of specific models—and contains no unverified performance conclusions.
2. Turning Natural Language Requirements into Acceptance Criteria
“Make a beautiful 3D demo” invites the model to improvise freely, making it hard to judge whether the result is acceptable. A more reliable approach is to decompose the requirement into explicit constraints and checkable outcomes.
The coastal riding scene can be divided into four groups of requirements.
2.1 Subject Requirements
The scene contains a recognizable bird character and a bicycle. The character should have basic structures such as a head, body, wings, and legs; the bicycle should have a frame, wheels, handlebars, and pedals.
The key here is not how much geometric detail there is, but whether the proportions, structural connections, and joint relationships are correct. Even with simple primitives, accurate silhouettes and consistent materials can produce a clear visual style.
2.2 Motion Requirements
Wheel rotation must match the forward motion of the bike, and the pedals and legs should move in coordination. The character must not simply be a static decoration attached to the bike.
If the bicycle stays in place while the road and environment move to create an impression of travel, that should be stated explicitly. This is a common technique, but it must not be conflated with actual spatial displacement.
2.3 Environment Requirements
The road, sea surface, sky, and distant scenery should form a continuous spatial relationship. Roadside plants, signage, or distant buildings can add depth, but decorations should not be endlessly stacked, which would obscure the main subject or push rendering costs out of control.
2.4 Delivery Requirements
Specify whether a single file is required, whether loading external scripts is allowed, whether network access is allowed, whether touch input is needed, and the target device types.
In particular, distinguish three concepts:
- No external images, models, or audio assets.
- The page consists of a single file.
- Fully offline with no external dependencies.
These are not equivalent. A single-page application may still download graphics dependencies at runtime. If offline operation is required, verify that all dependencies are bundled locally and test actual behavior with the network disabled.
3. Character Riding Scene: Coordinating Geometry, Motion, and Aesthetics
3.1 Procedural Modeling: Silhouette First, Details Later
Procedural modeling means creating geometry through code rather than loading ready-made models. For stylized characters, start by combining basic primitives such as spheres, cylinders, cones, and curves.
A sensible build order is:
- First establish overall proportions so the positions and relationships of the head, torso, and limbs are clear.
- Then set up a local hierarchy so legs can rotate around joints and the head can move independently.
- Finally add identifying details such as eyes, beak, and feather contours.
If you chase lots of local details from the start, later pose adjustments often require modifying many coordinates. Organizing parts in a parent-child hierarchy turns these adjustments into local rotations and translations, reducing maintenance burden.
3.2 Animation Should Be Driven by a Unified Time Source
The most common problem in riding animations is wheels, pedals, and legs each moving independently without a shared rhythm.
Under a no-slip rolling condition, wheel angular velocity relates to forward speed as:
ω = v / r
where ω is angular velocity, v is linear velocity, and r is wheel radius. This relationship can serve as the basis for visual consistency, but real riding also involves gearing, so pedal rotation speed should not simply default to the wheel rotation speed.
Here is an illustrative snippet independent of any specific graphics tool:
dt = min(current time - last time, maximum time step)accumulated time = accumulated time + dtwheel angle = wheel angle + forward speed / wheel radius * dtpedal phase = pedal phase + cadence angular velocity * dtleft foot target = pedal trajectory(pedal phase)right foot target = pedal trajectory(pedal phase + half rotation)
This example only describes time progression and phase relationships; it is not a complete leg animation algorithm. If the feet must stay on the pedals, you also need to compute leg joint poses from the pedal positions and handle unreachable target positions.
The upper bound on the time step reduces sudden jumps after the page has been suspended for a while. For physics calculations requiring strict numerical stability, use a fixed timestep update instead of simple truncation.
3.3 Aesthetics Come from Overall Consistency, Not Effect Count
The visual quality of a coastal scene usually depends on whether color, lighting, composition, and motion rhythm are unified.
For example, a warm sky against a cooler sea creates layering, but if the subject is strongly backlit, appropriate ambient lighting or rim light is needed to avoid losing character detail entirely. Distant scenery can be desaturated and its contrast lowered to make the subject easier to recognize.
When evaluating, inspect the default camera view, side views, close-ups, and the back. A beautiful default camera only proves that one composition works; it does not prove the whole scene has complete spatial quality.
4. Sea Surface: Distinguishing Visual Approximation from Physical Simulation
The sea is often the most eye-catching part of a demo—and the most likely to be overstated as “physically simulated.”
In reality, real-time ocean surfaces are commonly approximated using several techniques: modifying vertex heights with wave functions, adding fine ripples through normal perturbation, and combining view-dependent reflections, color changes, and specular highlights to create a water-like appearance.
The Fresnel effect describes how the proportion of reflected light changes with viewing angle. Using it in water shading helps express the difference in reflections between near and far regions and between grazing and perpendicular viewing angles.
But note:
- Simple waveforms do not amount to a full fluid simulation.
- Specular highlights and color gradients cannot replace actual scene reflections.
- Dolphins leaping or birds flying are additional animations and do not make the water simulation itself more accurate.
- The absence of external assets does not mean the absence of external code dependencies.
If the goal is a visual demo, these approximations are entirely reasonable. What should be avoided is describing artistic effects as scientifically accurate physical simulation.
5. Volcanic Eruption Scene: Organizing Complex Dynamics with Layered Systems
A volcanic eruption is a good test of whether a model can organize multiple effects into one system. It typically combines terrain, lava, ejected debris, smoke columns, and lighting changes; roughness in any layer can undermine the whole impression.
5.1 Terrain and Crater
The terrain should have clear slope variation and crater structure. A plain cone is easy to generate but tends to look mechanical. Controlled height perturbation can add irregularity while keeping the mountain silhouette stable.
What needs checking is not how complex the surface is, but whether the crater, ejection origin, and lava flow direction are spatially aligned.
5.2 Lava and Debris
Lava can be expressed through flow paths down the slopes, emissive materials, and color gradients—there’s no need to start with expensive fluid computation.
Ejected debris can be approximated with particles: give each particle an initial position, velocity, and lifetime, then apply gravity during updates. The basic motion relation can be written as:
p(t) = p₀ + v₀t + ½gt²
This describes simplified projectile motion that ignores factors such as air resistance. It provides a reasonable motion trend but is not sufficient for scientifically predicting a real volcanic process.
5.3 Smoke Columns and Transparent Layers
Smoke columns usually require many semi-transparent elements. The challenge is not only appearance but also transparency sorting, blending modes, and the rendering cost of repeated overdraw.
A sensible strategy is to limit particle counts, let smoke gradually expand and fade over its lifetime, and recycle particles once invisible. Use lower-detail representations for distant smoke so that not every element consumes the same computational resources.
5.4 Temporal Rhythm
An eruption should not maintain constant intensity. Design phases such as build-up, intensification, peak, and decay, varying debris count, smoke column height, and lighting intensity according to the state.
However, these phases should be labeled as demonstration logic, not as unverified models of natural processes.
6. Establishing a Reproducible Generation and Evaluation Workflow
To avoid “picking the best-looking run,” fix the task, record the process, and distinguish the first output from iterated results.
A practical workflow can include the following steps:
Step 1: Fix the input. Save the complete requirements, runtime constraints, and acceptance criteria, so different tests don’t use prompts of varying difficulty.
Step 2: Check the first delivery. Record whether it runs immediately, whether there are syntax errors, whether dependencies are missing, and whether core functionality is complete.
Step 3: Execute fixed interactions. Rotate the camera, zoom, resize the window, pause and resume, and let it run continuously for a while—in the same order each time.
Step 4: Record fixes. Save each round of modification instructions, the failure reasons, and the code changes. Reporting only the final result hides the actual cost of repairs.
Step 5: Check for regressions. Re-verify existing functionality after each fix, to avoid improving the water surface while breaking camera controls, or optimizing particle counts while breaking the eruption phases.
Scoring can focus on runtime completeness, requirement coverage, visual consistency, interaction quality, performance stability, and maintainability. Different applications warrant different weightings: presentation-focused projects should weight visual expression more heavily, while business systems should prioritize reliability, load speed, and maintenance cost.
7. What Else Is Needed to Turn Demo Code into an Engineering Deliverable
7.1 Performance Budget
Set resource budgets based on target devices, focusing on frame time, draw calls, geometry complexity, transparency overdraw, and memory usage—not just how it feels on the developer’s machine.
Optimization should start with measurement: confirm the bottleneck first, then consider merging duplicate geometry, reusing materials, reducing distant detail, or cutting transparent particles. Blindly simplifying without measuring may sacrifice visuals with no real gain.
7.2 Resource Lifecycle
When closing or switching scenes, stop animation loops, remove event listeners, and release graphics resources that are no longer used. Otherwise, opening the demo repeatedly can lead to persistent memory growth or duplicate updates.
7.3 Dependencies and Security
Before integrating generated code into production, check external requests, dynamic code execution logic, file access, and dependency licenses. Preview environments should be isolated from the real production environment and must not be given production credentials or sensitive data.
7.4 Maintainable Structure
A single file is convenient for demos, but a real project should still clearly separate scene initialization, object construction, animation updates, interaction handling, and resource cleanup. Key parameters should be centralized rather than scattered throughout the code.
If publishing is needed, common capabilities such as static file hosting, object storage, logging, and monitoring/alerting apply. Whether to introduce a container platform or other backend components should be decided by actual business requirements, not to make the architecture look sophisticated.
8. Conclusion: Real Improvement Means Reducing Verification Cost
The value of 3D code generation is not just getting a pretty picture quickly, but converting natural-language intent into an interactive system that runs, can be modified, and can be verified.
The character riding scene tests structure, animation, and aesthetic coordination; the volcanic eruption scene tests dynamic system organization, visual approximation, and performance management. Together, these two task types help identify whether a model is good at visual assembly or can reliably handle engineering constraints.
When evaluating capability, the most meaningful metrics are not how stunning a single demo is, but the first-run success rate, the cost of fixes, regression stability, and long-term maintenance difficulty. Only by incorporating these into evaluation can generative models move from creative assistance to reliable development collaboration.
