Sad-Happy Sun
By Eric Karpovits→This repo contains my CSC317 ray tracer assignment plus a script that animates the sun from sad to happy as well as making the eyes move. It does take a few minutes to reder everything.
I took my baseline A3 code/data/creative.json scene and wrote a script to turn it into a bunch of per-frame JSON/PPM files, then stitched everything into a video to make it look animated. I got inspirstion after watching ThePrimeTimeagen talk about FFmpeg and wanted to play around with it.
Features:
code/tools/animate_sun.pymoves the five white mouth spheres and two eye pupils, interpolating their centers over 24 frames. If interested, look atSAD_Y,HAPPY_Y, and theinterpolate_pointcalls insidegenerate_framesandrender_framesto see how the movement is applied. The script writescode/data/creative_frames/creative_frame_XXX.jsonplus renders all of them through the A3 assignment code.code/tools/run_sun_pipeline.shis the single command to run everything; it builds the renderer, generates the title, plus stiches everything together.
https://github.com/user-attachments/assets/e6e10f59-9956-455b-83ab-8d9293826b44
Acknowledgements
- ThePrimeTimeagen for inspiring me to use FFmpeg.
- A3 as the baseline code to perform all the raytracing.
- FFmpeg docs.
- The following Stack Overflow links: Text on video ffmpeg + FFmpeg example.