Rending a single frame of a Hollywood-quality movie may take minutes to hours even on a very fast computer. Rendering a movie measured in hours would take decades on a single computer. Fortunately, this is a perfect application of high-throughput computing. Each frame of a movie can be rendered on a different computer simultaneously, and then assembled at the end to produce a complete movie.
In this assignment, you will learn the basics of POVRay, an open source ray-tracing tool, and then use HTCondor to perform high-throughput generation of simple movies.
setenv PATH /afs/nd.edu/user37/ccl/software/external/povray/bin:$PATH setenv PATH /afs/nd.edu/user37/ccl/software/external/ffmpeg/bin:$PATHThen, download the example files rubiks.pov and WRC_RubiksCube.inc. (You can try out other examples from the POVRay collections site). To render a single image of a Rubik's cube:
povray +Irubiks.pov +Orubiks.pngAnd then display the output file:
display rubiks.png
Now, open up rubiks.pov in a text editor. The POVRay language describes exactly how to render the image, and the elements are fairly self explanatory. Scroll to the bottom, and look for the invocation of the cube:
object { WRC_RubiksRevenge("F'f' Rrd2R'r' U'u'Rr d2 U ld'l' U' ldl' R'r'Uu Ff") translate < -6.6/2, 0, -6.6/2 > rotate y*45 }WRC_RubiksRevenge is just a function defined in WRC_RubiksCube.inc, and the funny string following it simply defines how to set up the cubes and the colors. translate just moves the cube in the x, y, and z, directions, and rotate spins it around the Y axis by 45 degrees. (The cube is 6.5 centimeters on each edge, so the translate is just moving the rotation axis to the middle of the cube.)
Add a few more cubes to the scene by copying the object clause three or four times. For each one, tweak the rotation and add a second translate after the rotate to move the new cubes around the scene. Adjust the settings until you have a couple of cubes in the view.
Now, how do we make a movie? POVRay uses the built-in clock variable to represent the passage of time. clock is a floating point that varies only from zero to one through the course of an animation. You can set the clock value to, say, 0.5 by using the option +K.5.
For example, change one of the rotation statements to:
rotate y*(45+clock*360)Render three slightly different frames like this:
povray +Irubiks.pov +Oframe000.png +K.0 povray +Irubiks.pov +Oframe001.png +K.1 povray +Irubiks.pov +Oframe002.png +K.2And then join them into a movie like this:
ffmpeg -r 10 -i frame%03d.png -r ntsc movie.mpgYou can play the (very short) movie like this:
ffplay movie.mpg
condor_povray inputfile.pov outputfile.mpg numberofframes xsize ysizewhere the first argument is the input file to POVRay, the second argument is the output movie, the third is the number of frames to be created, and the fourth and fifth of the desired resolution. The user of condor_povray should not have to know anything about Condor; it should just work.
Note: Make a point of deleting all of your .png files when each movie is completed, otherwise you will quickly run out of disk space!
/afs/nd.edu/coursefa.18/cse/cse40822.01/dropbox/YOURNAME/a1Into that directory, submit:
(Don't do this until your main results are working!)