Draw and animate Mahabharata scenes in p5.brush code with two coding models

A Redditor had Gemini 4 Argon and GPT Sol 6.1 draw and animate a short Mahabharata sequence entirely in p5.brush code, then cut it into a video with music.

Done withGeminiChatGPT· Nov 4, 2026

What they did

The poster wanted to test how well coding agents could illustrate Indian mythology. They first tried structuring the story around the epic's 18 books, found that too abstract, and settled on a 58-point story outline that they worked through scene by scene. Gemini 4 Argon wrote the p5.brush code that drew the base visuals for each scene. Both Gemini and GPT Sol 6.1 then added motion, also in code, and Sol assembled the final video with a soundtrack made in Suno. The poster kept visual instructions loose on purpose to see what style the models would choose, and most of their feedback was about composition and whether each scene told its part of the story clearly.

How it went

The result is part 1 of the sequence, posted as a video, with every frame drawn and animated by generated code rather than an image or video model. The poster shared intermediate frames and animation examples in a separate thread on X. They give no figures for time spent, number of iterations or cost, and asked readers whether the story comes through from the visuals alone.

Worth knowing

The heavy lifting on structure was the poster's own: a detailed outline came before any code, and the first outline attempt was thrown away. The post names only the models, not the harness or tool they ran in. Suno was used for the music, not by the models themselves as far as the post says.

Try it

With Gemini· 4 parts to fill in

Help me illustrate [story or myth] as a short animated sequence drawn entirely in code with [p5.brush or another p5.js drawing library]. First turn my outline into a numbered list of [number] scenes, each with a one-line description of what must be visible for the story to read. Then, one scene at a time, write the sketch code that draws it, choosing a consistent visual style yourself, and add simple motion in code. After each scene, show me a rendered frame and wait for my notes on composition and clarity before moving on. Stop when all scenes in [part or chapter] are drawn and animated.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related