Prompt file imported from obhor/gargantua (
.claude/commands/render.md). Fill in{{arguments}}before use. Copyright stays with the author.
Render the Kerr black hole from kerr.cpp. One source file, both outputs — do
not create separate files for still vs video.
Arguments given: {{arguments}}
Do this:
-
Build if
kerris missing or older thankerr.cpp:g++ -std=c++17 -O3 -march=native -fopenmp kerr.cpp -o kerr -
Pick the mode. If
{{arguments}}says "video"/"orbit", do a video. If it says "still"/"image", do a still. If it's empty or unclear, ask with AskUserQuestion:- Still image — one frame, ~80 s, fast to check a change
- Orbit video — camera fly-around, ~20 s/frame, ~1.5 h for 300 frames
-
Still:
./kerr # -> kerr_hamiltonian.ppmConvert to PNG:
python3 -c "from PIL import Image; Image.open('kerr_hamiltonian.ppm').save('kerr_render.png')"(or
ffmpeg -i kerr_hamiltonian.ppm kerr_render.pngif PIL isn't around) -
Video (default 300 frames, or the number in
{{arguments}}):./kerr orbit <frames> # -> frames/f_%04d.ppm ffmpeg -framerate 30 -i frames/f_%04d.ppm \ -c:v libx264 -crf 18 -pix_fmt yuv420p -movflags +faststart \ -y gargantua_orbit.mp4Frames are already flipped in code — do not add
hflip,vflipor you undo it. Deleteframes/afterward (it's hundreds of MB). -
Show the result. For a still, Read the PNG so the user sees it. Report the output path and the wall-clock time.
