CMP 161 -- Programming Assignment 2
Due date:
10:00am, WEDNESDAY, 2/6/2002
Objectives:
Physically based modelling with simple spring-mass-damper systems.
To Do:
-
Write a program to simulate a waving flag using a spring-mass-damper system.
The flag can be modelled as a rectangular grid with tiny masses at each
vertex and a spring-damper pair at each edge.
As usual, you can break this problem down into different stages.
In your initial rendering, use wireframe drawing to make sure
vertices are moving the right way, and edges are compressing/stretching
the right way.
-
Later on, you'll want to add additional effects such as:
-
rendering the flag with texture maps,
-
varying the external forces (wind) on the flag,
-
adding additional forces such as gravity,
-
have the flag be attached to the flag pole either on
one side of the rectangle, at 2 points, at 1 point, or free flying.
The number of attachment points to the flag pole determines the
number of fixed vertices that don't move at all.
Without any attachment points to the flag pole,
the flag would fly away.
-
if the wind dies, the only remaining force would be gravity.
Incorporate checks to make sure flag does not penetrate
itself (optional).
-
Here's a couple of things to help you get started.
The spring models and numerical calculations (in 2D)
are available from the following url's. Note that you'll
still need to extend it to 3D.
Grading.
This program nominally accounts for 6% 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.
Submission must be done using the submit or xsubmit utility from CATS.
Run "quickhelp submit" on a CATS machine to find out more info.
- To submit use: submit cmps161-ap.w02 prog2 files
- To verify submission use: peek cmps161-ap.w02 prog2
These commands should work from any cats machine, but if there is a
problem try from teach.ic. Create and submit a subdirectory called
"prog2". It should contain all the files you have in make your
program compile/run.
Last modified
Tuesday, 22-Jan-2019 09:42:15 PST.