CMP 161 -- Programming Assignment 3
Due date:
12:00pm, FRI, 2/25/2005
Objectives:
Learn and implement simple physics based animation.
Useful Links:
To Do:
-
Simulate a ball bouncing on a trampoline.
You just need to do one ball,
but do this in 3D.
-
Break your program into stages
e.g. initially just have a ball bouncing on a floor.
Later, add the trampoline;
and possibly other effects e.g. have the ball spin too.
-
The key components of this assignment are:
(i) collision detection, and
(ii) calculation of forces.
You can assume that the ball is rigid and does not deform,
while the trampoline can be modeled by a mesh of springs.
The xspringies package has source code available that
illustrates how the force calculations are done in 2D.
You just need the gravitational and spring forces.
-
Required Items:
-
Allow the viewer to change viewpoint.
Use smooth shading for the ball,
and wireframe for the trampoline.
-
Allow the user to modify ball parameters:
(i) size and (ii) weight.
Color can be fixed up front.
-
Allow the user to modify trampoline parameters:
(i) spring constants and (ii) mesh resolution.
Varying the mesh resolution will allow
you to trade off speed vs realism.
-
Allow the user to specify
initial trajectory of ball.
For example, whether it's dropped from a certain
position, or thrown at an angle onto the trampoline.
-
What happens when the ball falls off the trampoline?
Assume you have a hard floor.
-
In your documentation,
describe how you deal with
ball-trampoline collision.
-
Optional Items:
-
Allow ball to spin. Apply texture on ball to
show that it's spinning.
-
Allow multiple balls.
You have to deal with ball-to-ball collisions
in addition to ball-trampoline collisions.
-
Allow nonrigid objects --
replace rigid ball with rubber ball or other
rubber objects --
meaning object deformations are modeled by springs also.
-
Ensure that the trampoline does not penetrate itself.
Items To Submit:
-
Html page with description, images and movies of your project.
Make sure your links are all local
and relative to your submit directory.
-
Makefile, code, README file, user guide.
-
You can submit your own test data files, or config files for your code.
However,
do not submit data files that we have provided.
Grading:
This program nominally accounts for 5% of your final grade. We must
be able to compile/test your code. Make sure that code and accompanying
make/project files, etc. must be tested for successful compilation at least on
the suns in the lab. For PC's, we will be using Visual C++. Also be sure to
include a README in your submission as to which platform to use. By the way,
if you're your development on PC's, you should be able to recompile your
fltk/opengl code on the suns with little or no modifications to your source.
Programs turned in at least a full day early will earn 1% bonus credit. Late
programs will be charged 1% late points. In addition, late programs will not
be accepted 24 hours past due date. Late programs and reports will not be
accepted for the final project. The bonus credits may be accumulated up to a
total of 50% toward program and final project credits. Programs are graded 80%
for functionality and correctness and 20% for style, readability,
documentation/writeup, and efficiency. Additional points may also be earned
for extra features.
Submission:
Create and submit a subdirectory called "prog3". It should contain
all the files you have to make your program compile/run. Include the other
items to be submitted in this directory as well. Submission must be done using
the submit utility from CATS.
-
To submit use: submit cmps161-ap.w05 prog3 files
-
To verify submission use: peek cmps161-ap.w05 prog3
These commands should work from any cats machine, but if there is a problem
try from unix.ic.
Last modified
Tuesday, 22-Jan-2019 09:42:15 PST.