Code-Generated Animation and Presentations: A Technical Shift in AI Visual Content

    This article explores the emerging approach of using code generation to produce animations, presentations, and interactive visuals. It explains why code-driven visuals form a distinct technical path compared to diffusion-based generation and template tools, breaks down the five-layer structure of a browser-rendered presentation, and covers narrative design for hand-drawn style clips and long-form scrolling visuals. It also details prompt and context engineering practices, a performance and engineering checklist, cloud deployment considerations, and the realistic capability boundaries of this paradigm.

    The overseas AI community was recently flooded with a wave of unusual creations: a presentation that racked up more than seven million views, a hand-drawn style short film, and a small 3D interactive scene all sparked extensive discussion. Notably, none of these were produced directly by a video generation model. Instead, an intelligent coding tool built them frame by frame by writing code. There were reports that a large model is undergoing a staged rollout, with some users noticing a clear shift in output style under the same input; the community has been referring to it informally by incrementing version numbers. Setting aside the version rumors, what truly deserves developers’ attention is the underlying technical paradigm: turning “generating visuals” into “generating executable code,” which a browser or runtime then renders in real time. This article centers on that paradigm, explaining its capability boundaries, implementation structure, and how to put it into engineering practice.

    Why “Building Visuals with Code” Is a Distinct Technical Path

    Traditional content generation falls into two categories. The first is diffusion-based generation from text to image or video, which excels at visual quality and realism but suffers from poor controllability, limited duration, and high revision cost. The second is template-based tooling that applies a layout and fills in content, producing stable output with an obvious ceiling. Code-generated visuals are a third path: the model outputs a structured program that a general-purpose rendering engine executes.

    This path has three natural advantages. First, editability: every element on screen is an object, and changing a single value takes effect globally. Second, resolution independence: vector and 3D scenes stay sharp at any size. Third, interactivity: a page can respond to clicks, scrolling, and keyboard input, something static video cannot offer. The tradeoff is that the model must possess both aesthetic judgment and engineering ability, and its output code must run correctly on the first try, which places higher demands on reasoning and long-context capabilities.

    Dissecting an Animated Presentation

    Take the presentation that drew attention as an example. It is essentially a single-page application, roughly five megabytes in size, containing thirteen scenes that render in real time the moment you open the browser. Broken down for engineering purposes, it splits into five layers:

    1. Scene Graph: defines the hierarchy, with camera, lights, models, and text panels attached under the root node.
    2. Timeline: describes property changes with keyframes, such as camera movement, opacity, and scaling.
    3. Render Pipeline: handles geometry submission, material shading, and post-processing, determining the final look.
    4. Interaction Layer: manages page turns, scrolling, and focus switching, turning linear playback into an explorable narrative.
    5. Resource Layer: loading and caching strategies for fonts, textures, and audio, which directly affect first-screen time.

    The following is illustrative code showing how to describe a “flat chart to 3D space” transition declaratively, so readers can understand how keyframes and easing functions work together:

    1. // Illustrative code: keyframe-driven camera and element transition
    2. const scenes = [
    3. { id: 1, camera: { z: 12, fov: 45 }, chart: { depth: 0 } },
    4. { id: 2, camera: { z: 6, fov: 38 }, chart: { depth: 3 } }
    5. ];
    6. function lerp(a, b, t) { return a + (b - a) * t; }
    7. function easeInOutCubic(t) {
    8. return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
    9. }
    10. function applyFrame(from, to, progress) {
    11. const t = easeInOutCubic(progress);
    12. camera.position.z = lerp(from.camera.z, to.camera.z, t);
    13. camera.fov = lerp(from.camera.fov, to.camera.fov, t);
    14. chart.scale.z = lerp(from.chart.depth, to.chart.depth, t);
    15. }

    Hand-Drawn Shorts vs. Dynamic Long Scrolls: Differences in Narrative Structure

    The core of a hand-drawn style short is not how closely it resembles a drawing, but the rhythmic sense of “line jitter.” In engineering terms, static illustrations are usually split into layered assets, with slight displacement, rotation, and noise perturbation creating a breathing effect, combined with alternating frame-by-frame textures to produce stroke variation. The background music is generated by procedural audio synthesis, avoiding copyright issues from external assets.

    The dynamic long scroll solves a different problem: high information density and a large time span. A traditional timeline is a single line with a few annotations, whereas continuous visual narrative requires the camera to advance smoothly through a long space, with historical content distributed across different spatial coordinates in chronological order. The key here is spatial arrangement and scheduling: elements outside the field of view must be culled or downgraded, or the scene will drop frames once it grows complex.

    Prompt and Context Engineering: The Invisible Variable That Decides Success

    With the same model, differences in output quality often come from how the input is organized. Reusable practices include: first provide the role setup and output constraints (single file, no external dependencies, target frame rate), then provide a scene list with a one-sentence intent for each scene, and finally add abstract descriptions of aesthetic references (color tendencies, whitespace ratio, transition pacing) rather than letting the model improvise freely. Feeding a long document in segments and requiring the model to first produce a structural skeleton and then fill it in section by section can significantly reduce the failure rate of generating very long code in a single pass.

    Performance and Engineering Constraints Checklist

    • First-screen time: control resource size, subset fonts, compress textures.
    • Frame rate stability: control draw batches, avoid creating large numbers of temporary objects inside animation callbacks.
    • Memory usage: promptly release geometry and textures that are no longer used.
    • Accessibility: provide a fallback for animation and respect the system’s reduced-motion setting.
    • Compatibility: feature-detect graphics interface capabilities and fall back to static presentation when they are missing.

    Deploying on the Cloud: From Demo to Deliverable Product

    To turn this kind of “code as content” output into an external service, four general capabilities typically need to work together: a container platform to host stateless rendering services and scale elastically with traffic; object storage to distribute static assets and versioned artifacts; a message queue to smooth out peaks and generate long-running tasks asynchronously; and logging services with monitoring and alerting to cover rendering failure rates and latency metrics. Baidu AI Cloud offers corresponding product forms across these general categories, and developers can select based on their own architecture without being locked into a specific implementation.

    Capability Boundaries and Rational Expectations

    It should be clear that code-generated visuals are not good at photorealistic rendering or complex physics simulation, nor are they suited to very long durations. Its sweet spot is presentations, teaching, product explainers, and lightweight interaction. The version number information circulating in the community has not been officially confirmed, so developers should focus on verifiable engineering metrics rather than version rumors.

    Conclusion: From “Generating Content” to “Generating Programs”

    The shift from “generating content” to “generating programs” is one of the most substantial recent advances in intelligent coding tools. It requires users to move from being prompt writers to being system designers: defining structure, constraining resources, and planning fallbacks. By mastering this approach, teams can produce presentations and interactive experiences at very low cost that previously required professional motion design and design collaboration. This is precisely the part of the current technical dividend that ordinary developers can most easily capture.