cp -R ~cs314/Vjan2006/a1_code . cd a1_code makeType 'a' to see a very simple arm animation.
You will be computing all the vertex locations.
First use GL_LINE_LOOP in order to draw the tapered
cylinder in wire frame. Once this works, compute a surface normal
for each vertex and call glNormal3f() before each glVertex3f() call
in order to assign a correct surface normal to each vertex, and
change to using GL_POLYGON,
GL_QUADS, or GL_QUAD_STRIP, thus producing a solid-shaded tapered cylinder.
Each line of keyframe data will specify all of the ``degrees of freedom of the character''. Below is an example of how you might do this, although I recommend that you come up with your own set of degrees-of-freedom that work for your particular figure and the animation that you have in mind. You could also use this to animate camera parameters, colour parameters, or the movement of other objects. Lastly, you could also use additional keystroke bindings to interactively animate parts of your scene.
keyframe 0.4 2.0 1.0 10 20 10 10 -20 10 10 40 50 -40 50 10 20where:
parameter 1: time stamp (ignore this for now) parameter 2: body location, x parameter 3: body location, y parameter 4: body lean parameter 5: right hip angle parameter 6: right knee angle parameter 7: right ankle angle parameter 8: left hip angle parameter 9: left knee angle parameter 10: left ankle angle parameter 11: left wing angle parameter 12: right wing angle parameter 13: neck forward bend parameter 14: head forward bend parameter 15: head twist parameter 16: head roll
Because you will need to temporarily create a large number of images that will consume a fair bit of disk space, create a temporary directory /tmp/foo where foo is your user name. Edit the appropriate line in the dumpPPM() function call in order to ensure that image files get written to this directory. Now hit 'd' when running your code and you should get a large number of PPM files being written to this directory of the form imgNNN.ppm, where NNN is the frame number. To convert these image files to an MPEG movie, use
ffmpeg -i img%03d.ppm -r 24 a1.mp4Don't forget to delete all your PPM files once your movie has been created. You can play your movie using
ffplay a1.mp4If you want to keep your movies reasonably small in size, I recommend choosing an appropriate window size for your animation. For example, a 500 x 300 video will be approximately 1/4 the size of a 1000 x 600 video.
handin cs314 assn1This will handin your assn1 directory tree by making a copy of your assn1 directory. Note that subdirectories will not be copied. If you want to know more about this handin command, use: man handin.