Movies from OpenGL

This is how to make a movie from your OpenGL programs, which you can put on a web site or otherwise distribute to impress your family, friends, and potential employers.

Movies made by capturing frames from real-time 3D games are called machinima.

Download the C version or Java version of MovieCube. Inside the tar file is a modified cube program and glmovie.h/.c or GLMovie.java that captures the OpenGL frame buffer as an image file.

The cube source has a few new lines, marked by "NEW" comments. There are various capture parameters you can set, but the defaults work.

Build and run the MovieCube program. You start capturing frames by pressing the M key or choosing Movie from the menu, and press/choose again to stop. This will generate a numbered sequence of PPM files in the /tmp directory. Stop after twenty or so.

You can preview the movie with

$ animate /tmp/username*.ppm

animate is part of ImageMagick. The frames will be upside down: this is nothing to worry about and will be fixed in the final movie.

Assemble the frames into the final output file with

$ convert -flip /tmp/username*.ppm /tmp/cube.mpg

This will take several minutes to complete. convert is another of the ImageMagick tools.

You now have an MPEG file. You can view it with

$ ffplay /tmp/cube.mpg
on the R105 PCs, or with any other movie player application that understands the format, such as QuickTime Movie Player on a Macintosh.

Now that you know how it's done, add the capture code to Assignment 2. Things to look out for: