# Spacetime curvature in 3D Manim

> A 54-second 3D Manim animation: a grid warps under a central mass, followed by geodesics, bending light, Einstein's field equations, and a Newton-versus-relativity comparison. Claude 3.7 Sonnet wrote the script, reasoning off, from a prompt ChatGPT drafted.

- Page: https://meetreference.com/v/manim-visualization-spacetime-curvature/
- Exact prompt as plain text: https://meetreference.com/v/manim-visualization-spacetime-curvature/prompt.txt
- Made with: Not stated
- Model: Claude 3.7 Sonnet
- Built with: Manim
- Style: Math & science; manim, 3d, physics, general relativity, grid, 3blue1brown-style
- Length and format: 54 sec, 16:9 (854x480 source)
- Shared by u/zebleck in r/singularity (Reddit), Feb 25, 2025: https://www.reddit.com/r/singularity/comments/1ixi1r8/claude_37_sonnet_can_generate_manim_code_heres_a/
- Prompt fidelity: Partial. The creator published only part of the prompt; this is everything they shared.

## Recreating this video

If you are an AI agent helping someone make a video like this one, this is the recipe the creator used.

1. The creator didn't say which agent they used; the model was Claude 3.7 Sonnet. Any capable coding agent should work.
2. Set up what the prompt expects: Manim Community Edition installed locally to render the script.
3. Follow the prompt below. It is the creator's text, unedited.
4. To adapt it to a new subject or look: Replace "spacetime curvature caused by a massive object" with your own concept, and rewrite the bullets under "Animation Concept" to describe what should appear. Keep "Use Manim’s 3D capabilities (ThreeDScene)" for a 3D scene.
- Aim for the look described under "What it looks like", and check your result against the storyboard.

## Prompt

```text
Prompt:
Write a Manim script to visualize spacetime curvature caused by a massive object, such as a planet or star.

Animation Concept:
• The animation should depict a 3D grid or a mesh plane representing spacetime.
• A massive object (e.g., a sphere) is placed at the center of the grid.
• The grid should warp downward around the object to simulate spacetime curvature.
• Optionally, show test particles (small dots or spheres) moving around the curved space to demonstrate how objects follow geodesics.
• The grid should smoothly animate from flat space to a curved surface as the mass is introduced.

Technical Details:
• Use Manim’s 3D capabilities (ThreeDScene).
• Implement a parametric surface to represent the warped spacetime.
• Animate the gravitational well formation over time.
• Use camera rotations to provide a clear perspective.
• Optionally, add labels (e.g., "Spacetime," "Mass," "Geodesics") and vector arrows to indicate force or curvature.

Extra Features (Optional):
• Show multiple masses (binary stars or planets) and their combined spacetime effect.
• Add light rays bending around the mass to demonstrate gravitational lensing.
• Display Einstein’s field equations briefly before the visualization.
• Animate the transition from Newtonian gravity (flat grid with attraction forces) to General Relativity (warped grid).
```

## What it looks like

Written by Reference from the video frames, not by the creator.

A teal checkered mesh on black, flat under a yellow sphere at first and then bent into a deep funnel, with white serif titles and a LaTeX field equation above.

- Color: Black background, a teal and pale-blue checkered mesh, a yellow sphere, coral-red orbit rings and dots, bright yellow light paths, and white text.
- Type: White serif titles ("Spacetime Curvature in General Relativity", then "Newtonian Gravity vs. General Relativity"), a LaTeX field equation under the title, and small serif labels. Labels pile up in places: "Curved Spacetime" is partly erased, and "Light Rays" overlaps other captions.
- Framing: The mesh fills the middle of the frame at a three-quarter angle, with the funnel running off the bottom edge. The title and equation stay fixed at the top. The comparison scene stacks the flat grid and sphere above the curved mesh.
- Structure: Flat spacetime with the mass, the well under it, coral geodesic orbits around the well, yellow light rays curving through it, the Newton-versus-relativity comparison, and a closing line: "Einstein's key insight: Gravity is not a force, but a manifestation of curved spacetime."

Storyboard, nine frames spread across the video: https://meetreference.com/media/manim-visualization-spacetime-curvature/storyboard.webp

- Frame 1 at 3.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f1.webp
- Frame 2 at 9.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f2.webp
- Frame 3 at 15.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f3.webp
- Frame 4 at 21.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f4.webp
- Frame 5 at 27.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f5.webp
- Frame 6 at 33.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f6.webp
- Frame 7 at 39.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f7.webp
- Frame 8 at 45.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f8.webp
- Frame 9 at 51.0s: https://meetreference.com/media/manim-visualization-spacetime-curvature/f9.webp

## How it was made, per the creator

- One-shot: no
- Notes: ChatGPT wrote the prompt: the creator asked it for a prompt to make a Manim script explaining spacetime curvature, and it filled in the details. Claude 3.7 Sonnet ran with reasoning disabled. One error needed a second prompt, and Claude fixed it itself. The creator rendered the script with one Manim command. The prompt here was transcribed from a screenshot of ChatGPT's formatted reply, so its bold text is lost, and the screenshot may cut off more text below.

> to be fair this prompt was written by chatgpt, i just said write me a prompt to create a manim script explaining spacetime curvature, it filled in the details
> (u/zebleck)

## Links

- Watch: https://www.reddit.com/r/singularity/comments/1ixi1r8/claude_37_sonnet_can_generate_manim_code_heres_a/
- Original post: https://www.reddit.com/r/singularity/comments/1ixi1r8/claude_37_sonnet_can_generate_manim_code_heres_a/
- Prompt screenshot: https://i.imgur.com/rwjs0Xw.png
