Testing LLM Code Generation: A Technical Breakdown from 3D Animation to Particle Art

    This article examines the real boundaries of large language models when generating graphics code, drawing on community test cases such as a Three.js cycling animation and a multi-chapter particle art short film. It breaks down the technical challenges of AI-generated 3D visuals, the consistency problems that surface during long iterative sessions, a five-dimension framework for evaluating code generation, and practical advice developers can apply to their own workflows.

    As large language models rapidly improve at writing code, more developers are using natural language to drive complex graphics tasks. Several interesting test cases have recently appeared in the community: asking different models to generate a Three.js cycling animation from the same prompt, and refining a particle art short film through multi-turn dialogue. On the surface these are just “fun demos,” but they expose the real limits of LLMs at generating graphics code. Starting from these tests, this article systematically breaks down the technical difficulties, evaluation dimensions, and practical methods behind AI-generated 3D visuals.

    Why “a person riding a road bike” is a hard problem

    In computer graphics, building a scene like “a rider leaning forward on a road bike” purely in code is essentially a kinematics constraint-solving problem, far harder than generating an ordinary UI component:

    1. Pose and skeleton constraints

    The rider’s forward-leaning posture must satisfy several constraints at once: the torso’s forward tilt angle, the contact points between hands and handlebars, the circular motion of the legs pedaling, and the fit between the feet and the clipless pedals. If any single constraint is unmet, the image shows an obvious flaw such as “floating hands” or “feet clipping through the frame.” The model must correctly understand the range of motion of human joints and translate the pedaling cycle into a linkage function between crank rotation and the angles of the ankle, knee, and hip:

    1. // Core of the pedaling cycle: the crank angle drives the lower-limb joint chain
    2. const crankAngle = elapsed * cadence; // cadence
    3. const pedalPos = crankOrigin + rotate(pedalOffset, crankAngle);
    4. const legPose = solveTwoBoneIK(hipPos, pedalPos, thighLen, shinLen);

    2. Spatial layering and depth of field

    A strong image also needs clear layering from a distant sunset, mountains, and wind turbines. This involves camera parameters, fog effects, and distance-based material attenuation, among other settings. Weaker models often generate only the subject; the background is either missing or indistinguishable from the foreground, and the overall sense of space collapses.

    3. Completeness of detail

    The test comparisons reveal clear tiers: stronger models accurately reproduce details such as the helmet, goggles, cycling-kit colors, disc brake rotors, and bottle cages, with correct positional relationships between parts. Weaker models frequently omit parts or get proportions wrong. This density of detail is precisely the touchstone that separates models by the depth of their code understanding and generation.

    The consistency challenge in long iterative sessions

    If a single-frame animation tests the ability to “get it right in one shot,” then a continuous particle animation tests context consistency across long, multi-turn iteration.

    One notable community case: a developer spent nearly an hour of multi-turn revisions refining a particle art piece titled Artistic Butterflies. The core difficulties of this kind of task include:

    1. Force-field equations controlling tens of thousands of particles

    The particles’ spawn positions, initial velocities, and decay timing must all be described by unified force-field equations. The model must ensure that after each round of edits, the force-field parameters and the rendering pipeline remain self-consistent, avoiding regressions like “edit chapter A and the particles in chapter B explode.”

    2. Cross-chapter consistency of transitions and lighting

    A multi-chapter animation requires globally consistent transition styles, lighting models, and color tones. This places heavy demands on the model’s long-term context memory: it must “remember” the visual language established at minute 10 and continue to honor it during edits at minute 50.

    Practical tip: During long iterative sessions, developers should proactively maintain a “design constraint list” and restate key agreements (color palette, upper limit on particle count, performance budget) with each round of edits, reducing the regression risk caused by the model forgetting.

    How to scientifically evaluate a model’s code generation

    These cases yield a general evaluation framework:

    1. Constraint satisfaction: Whether hard constraints such as kinematics and physics are correctly implemented, and whether any obvious flaws remain;
    2. Detail density: The degree of detail reproduced, given a correct main structure;
    3. Context consistency: Whether global style and logic stay unified across multiple iterations;
    4. Code readability: Whether the generated code is clearly structured and easy for a human to modify;
    5. First-pass rate: How usable the first generation is, which directly determines iteration cost.

    Practical advice for developers

    First, actually use it. Evaluating model capability shouldn’t stop at benchmark scores and other people’s reviews. It’s worth integrating at least one LLM coding assistant into your own workflow and calibrating your intuition with real tasks. Many developers report that certain models excel particularly at “reading code,” and that understanding an existing codebase quickly and accurately is sometimes more valuable than generating new code.

    Second, pick the right task type. Strongly constrained tasks with strong visual feedback, such as graphics and animation, are excellent touchstones for testing model capability: right and wrong are obvious at a glance, and nothing can slip by just by “looking the part.”

    Third, build your own evaluation set. Distill the typical tasks from your daily development into a fixed set of test cases, run them after each model update, and build a comparable, reproducible capability profile, rather than relying on the conclusion of a single community blogger.

    Conclusion

    From 3D cycling animations to particle art short films, these test cases reveal a trend: large language models are moving from “good enough to run” toward “precisely satisfying complex constraints.” For developers, rather than arguing over which model is stronger, it’s better to build your own evaluation system and genuinely embed model capability into your daily workflow—that is the most certain part of this wave of technological gains.