CPSC 533B Animation Physics

January-April 2004, T and TH 9:30am-11am, in MacMillan 256

Instructor: Robert Bridson

Prerequisites: programming experience, differential equations, physics (continuum mechanics is a big plus, but not necessary), basic numerical analysis, basic computer graphics (but simple rendering code will be supplied)

This course gives a practical introduction to the use of numerical simulation for animating natural phenomena, such as the motion and interaction of rigid bodies, cloth, smoke, water, etc. The emphasis is on passive, uncontrolled motion (as opposed to human locomotion for example) but artistic control will be mentioned.

Contacting Me

You can always email me at rbridson @ cs.ubc.ca, or phone my office 604-822-1993. My office is in CICSR 189; either drop by (I'm in most of the time 9:30-5:30) or email me to set up an appointment to be sure of seeing me.

I'm happy to help out with stuff, and also appreciate feedback on the course---if the pace is right, if you want to see some particular topic covered, etc.

Assignments

Here are a few of the final projects

There will be six programming assignments, essentially implementing some of the algorithms discussed in class. They will also have a small written component.

The first assignment counts for 10% of your final grade, and the other five assignments each count for 15%.

To hand in the programming part of an assignment, email me the source code and instructions for compiling/running it. Please don't email very large data files (instead put them on the CS file system or the web somewhere I can get them). To hand in the written component, either email it to me (preferably in plain text or PDF), give it to me in person, or slide it under my office door.

I'll try to provide some C code as a starting point for the assignments, but you may use any language within reason. I'll need to be able to compile/run your stuff; at least ensure that the language and libraries you are using are installed on the CS department servers---as I write this, languages I can deal with include C, C++, Objective C, Java, Fortran 77 and 90, Common Lisp, Scheme, Standard ML, OCAML, Python, Perl, Prolog, Matlab, Octave, ... Remember that speed is important here, and I will penalize ridiculously slow programs, so be reasonable.

It is fine to use code from other sources as long as (1) you properly attribute it and (2) it doesn't defeat the point of the assignment. For example, if I teach something in class you should not use someone else's code for that, but other support code (e.g. solving dense linear systems, FFT, generic data structures) is fair game. This can be delicate particularly for languages like Matlab, which include a whole bunch of built-in functions for numerical computing---if in doubt about something, ask me before the assignment is due!

I understand it is sometimes difficult to turn in assignments on time due to unforeseen emergencies. If you have a good reason you can't turn something in on time, please contact me as soon as possible about it and we can work something out. Otherwise, there will be a 20% penalty per day late, starting when I come to my office in the morning after the due date.

Final Project

There will also be a final project worth another 15%. I expect this will be an extension of one of the assignments apart from the first; each of these assignments will include suggestions for extensions that you could do to make it your final project. If you want to do something else, either an extension I haven't listed or maybe something completely different not related to the assignments, that's great! but you need to talk to me and get it approved.

You will need to submit the source code and a short write-up explaining what you did and how. There will also be an informal demo screening at the end of the course where you will show it to the class. This will just be a couple of minutes, briefly explaining what you did and showing the results (you can send me a movie to run on my laptop, or make other arrangements ahead of time).

Note that the late penalty for the final project will start immediately if you do not have it ready for presentation in class.

Resources

There is no assigned text, but I will provide references to useful books, papers, etc. I will assume for basic numerical analysis you can pick your own favourite text.

Note: I generally will not provide the papers in class or as links on this page; instead it is up to you to find them. The web is now a wonderful resource for finding papers. Preprints of many papers can be found on the authors' websites---use a search engine like Google to find these. Papers that appear in places like SIGGRAPH, ACM Transactions on Graphics (TOG) and Symposium on Computer Animation (SCA) can be found in the ACM Digital Library (http://www.acm.org/dl) but you will need to be logged into a UBC machine or go though the proxy server. Other journals to which UBC subscribes can be found by their search page; often you will find that recent articles were published electronically and UBC has a subscription that lets you read them online (like the ACM Digital Library). Finally there is the last resort of actually going to the library to look at a paper copy, or ordering through InterLibrary Loan if UBC doesn't have it at all.

Please find the following articles and read them:

For an alternative look at rigid body dynamics, check out Physically Based Modeling course notes from SIGGRAPH 2001, by Andrew Witkin and David Baraff. I have tried to use the same notation as them for consistency. Their notes also cover other topics addressed in this course in a different way, and a few topics that are not.

More advanced optional reading. The abbreviation "JCP" means Journal of Computational Physics, "Numer. Math." means Numerische Mathematik, and "jgt" is the Journal of Graphics Tools.

For making MPEG animations of your movies from a sequence of still images, try "ppmtompeg", which is installed on (at least some of) the CS grad machines. You may need to use "convert" to change formats to PPM or JPEG, which is what ppmtompeg likes. Jason Harrison put together a script mkmpeg (download it, don't read it directly) as an easier front-end to this program; it generates a parameter file etc. for you. If you have access to a machine with Quicktime Pro, such as via a guest account on any of the Mac's in FSC 2330, you can generate higher quality .MOV files (e.g. with the MPEG-4 codec, which is usually the best) from a sequence of images. Note that Quicktime doesn't read PPM natively, but it does read SGI, JPEG, and several others.

Note: you can end up using a lot of disk space for temporary data files and images while you're creating animations. Rather than using precious NFS file server space (and your quota) for these temporary files, stick them on the local /tmp directory (inside a directory you create), make your animation, and then save just the compressed animation file in your home directory (or wherever you want). Note that files in /tmp may be deleted at any time, though it would be courteous to remove your temporary files after you've made an animation.

Miscellaneous other resources:

Schedule

This is approximate and will become firmer as the course progresses. I've put links to the lecture slides as they become available. Please note that while all the fonts are embedded as needed in these PDF files, the printing system on the CS machines uses "acroread -toPostScript" to convert PDF to postscript for printing and in doing so strips out the fonts. Thus mathematical symbols are botched up by the printer, while looking fine on screen. To get around this, use "pdf2ps" to convert to postscript first, then print the postscript file.

DateTopic (and Slides)Work
 January 6  Introduction; first order time integration; particle systems Assignment 1 out
Second order time integration; some particle forces
13  Noise; particle collisions and contact
15  Particle collisions and object geometry Assignment 1 due
Assignment 2 out
20  More collisions; rigid body dynamics
22  Rigid body collisions
27  Constrained dynamics - soft constraints, Lagrange multipliers, discrete projection Assignment 3 out
29  Constrained dynamics - generalized coordinates; mass-spring systems for elastic bodies Assignment 2 due
 February 3  Elasticity theory, start of Finite Volume Method
Finite Volumes, Finite Elements
10  Review rigid bodies, start of cloth
12  Cloth bending, shells, cloth collisions
Assignment 4 out
13  (none) Assignment 3 due
24  More cloth collisions, 3D elasticity, modal analysis
26  More cloth collisions, Schur complement, BEM, 1D inelasticity
March 2  3D inelasticity and fracture
Introduction to fluid mechanics Assignment 4 due
Deep water waves and Fourier analysis Assignment 5 out
11  Shallow water waves with PDE's
16  Start of smoke; projection, linear solvers, viscosity
18  Smoke advection, temperature and buoyancy in smoke Assignment 5 due
Assignment 6 out
23  Start of water: boundary conditions, interface methods
25  Particle-level set, artificial compressibility, SPH Finalize project topic
30  Fire Assignment 6 due
April 1  Clouds Check in with me about
final project - work out
how you will present it
Guest lecture: Kees van den Doel
Demo: show your work Final project due in class