Evaluating Chinese LLMs on 3D Code Generation: Methods and Takeaways

    This article examines how to evaluate the 3D code generation capabilities of large language models, using two representative test cases: a high-freedom creative scene and a physical eruption simulation. It breaks down assessment into dimensions such as subject modeling, environment completeness, lighting and materials, interaction and performance, physical intuition, rendering layers, resource management, and code readability. It also outlines a three-round refinement workflow, the technical drivers behind capability gains, and engineering practices for production use.

    1. Introduction: Why 3D Code Generation Is a True Test of Model Capability

    Generating a runnable web page is no longer a difficult task in modern coding-capability evaluations. Generating a 3D scene that is visually appealing, spatially coherent, and robust in its details, however, puts a model’s综合 capabilities to a much deeper test. This article uses two representative test cases as a thread and abstracts a methodology for evaluating this kind of ability: one is high-freedom creative scene generation, and the other is a complex effect demo that involves physical process simulation.

    There are three reasons for choosing 3D scenes as the test vehicle:

    • Coupled multi-constraints: The model must satisfy multiple layers of constraints at once, including geometric structure, materials and lighting, camera control, and interaction logic.
    • Long-context consistency: Objects, coordinates, and animation states in the scene must remain logically consistent, with no “drift.”
    • Aesthetics cannot be faked: Whether a scene is visually harmonious cannot be hidden by piling up code; it depends on a genuine understanding of composition, color, and light.

    2. Case One: Generating and Refining a High-Freedom Creative Scene

    2.1 Test Design

    The first case uses an open-ended creative prompt: given an imaginative subject and action, the model is asked to output an interactive 3D web page, with an emphasis on “using all of its design ability.” The point of such a prompt is not a feature checklist, but whether the model can autonomously fill in the scene setup, environmental atmosphere, and narrative details.

    2.2 Evaluation Dimensions

    The generated result can be assessed across four layers:

    1. Subject modeling quality: body proportions, joint structure, and naturalness of motion.
    2. Environment completeness: whether supporting elements such as ground, roads, vegetation, and street signs are self-consistent.
    3. Lighting and materials: whether there is a unified time-of-day atmosphere (for example, warm dusk tones), and whether metal, water, and vegetation respond differently.
    4. Interaction and performance: whether dragging the viewpoint is smooth, whether the animation loop is stable, and whether all resources are generated by code rather than pulled from external references.

    2.3 Iterative Refinement

    Getting a perfect result in one shot is unlikely in practice. A “three-round convergence” approach is recommended:

    • Round one: confirm the subject structure and camera interactivity.
    • Round two: fill in the environment and atmosphere, unifying color temperature and fog effects.
    • Round three: strengthen details, such as the layering of distant scenery, dynamic elements (birds in flight, creatures leaping out of the water), and water reflections.

    A sample prompt structure looks like this:

    1. Role: Senior 3D web designer
    2. Task: Generate a single-file, runnable 3D scene
    3. Constraints: Pure code generation, no external assets; support mouse-drag orbit viewing
    4. Focus: Unified dusk tones, natural water reflections, smooth looping subject motion
    5. Output: Complete HTML with the necessary styles and scripts

    3. Case Two: The Value of Physical Process Simulation Demos

    3.1 Why Choose an “Eruption Simulation”

    The second case asks for a 3D demo that includes an eruption process. It looks simple but actually tests several things at once: how the particle system is organized, timeline and state-machine design, lighting that changes in sync with events, and stability over long runtimes.

    3.2 Key Evaluation Points

    • Physical intuition: whether the initial velocity, gravity, and damping of the ejected material are close to common sense.
    • Rendering layers: whether smoke, fire, and debris are handled in layers rather than blurring into a single mass.
    • Resource management: whether particle counts and geometry reuse are reasonable, and whether the frame rate is acceptable.
    • Code readability: whether the structure is modular and easy to modify later.

    A simplified particle update logic example:

    1. // Each particle maintains position, velocity, and lifetime
    2. particle.position.addScaledVector(particle.velocity, dt);
    3. particle.velocity.y -= gravity * dt; // gravity
    4. particle.velocity.multiplyScalar(1 - drag * dt); // damping
    5. particle.life -= dt;
    6. if (particle.life <= 0) resetParticle(particle);

    4. The Technical Logic Behind the Capability Leap

    Improvements in this kind of performance usually come from three capabilities working together: first, structural preservation over long context, where the model keeps naming and coordinate systems consistent across hundreds of lines of code; second, convergent tool-style generation, where it translates vague aesthetic requirements into concrete parameter ranges; and third, a self-correction tendency, where it proactively adjusts when errors occur or results look poor instead of repeating the same output.

    5. Recommendations for Enterprise Adoption

    To use this kind of capability in production, it is worth paying attention to engineering support: bring generated results into code hosting and version control, unify runtime environments through a container platform, track anomalies with logging services and monitoring alerts, and accumulate reusable scene assets with object storage. Baidu AI Cloud offers corresponding capabilities in these general categories and can serve as a reference foundation for building an intelligent coding toolchain.

    6. Conclusion

    3D code generation is moving from “it runs” to “it looks good and holds up.” For developers, real capability lies not in a single impressive result, but in reproducible prompt design, measurable evaluation dimensions, and a sustainable engineering workflow.