The focus of this assignment is building graphical objects out of higher-level components than vertices and polygons. There are two pieces of it: the clown and a library function.
Build a scene that looks like the following "clown." You can run this program on any of the Linux machines except Puma.
~cs307/public_html/assignments/clown
The goal of this assignment is to work with the affine transformations
of translation, rotation and scale, and also the matrix stack. Ideally,
I'd like to see you work with different embedded frames
(a frame is
a coordinate system: axes plus an origin). I'll leave you to decide what
frames are useful, but it will help to think modularly.
Try to avoid magic constants
for positioning, angles, scaling,
and so forth (meaning unlabeled, undocumented numbers directly in the
modeling code). Some of these are inevitable, of course, but there are
connections among them, too. The positioning of the hand is related to
the length of the arm, for example. The positioning of the pom-pom is
related to the positioning and dimensions of the hat. Try to make these
relationships clear in your code.
Also, try to make your clown flexible. For example, suppose your boss at Pixar says that the head needs be bigger, flatter, wider, or whatever: what needs to be changed in your code? Try to make it easy to adjust things like this, either by coding or documentation.
Please read the standard instructions for all assignments
Look through the graphical objects that have been contributed to our 307 library by former students. You can find these in the following directories:
~cs307/pub/tw/f05/ ~cs307/pub/tw/f06/ ~cs307/pub/tw/f07/
(This course wasn't taught last fall, which is why there is
no f08 directory.)
Each person contributed some source code as a .cpp file.
She also contributed a demo
version of her object, so that you
can run the file to see what the object looks like. The source code for
that is a .cc file, and the executable demo program has no
extension.
For example, if Jackie Shaw contributed a guitar, she submitted the following files:
~cs307/pub/tw/f07/jshaw.cpp
~cs307/pub/tw/f07/jshaw_guitar.cc
~cs307/pub/tw/f07/jshaw_guitar
where the first is the code for a guitar, the second calls the code defined in the first, and the third is an actually runnable file.
What you must do:
portto Python. Compare Justine Aylmer's source code files to the port of her code in pytw/jaylmer.py. (You can see one advantage of Python in that we only have to worry about one file, not three or more). Another example is pytw/wwellesl.py, though that one was written from scratch, rather than ported from C.
claimthe object(s). That way, no one will duplicate anyone else's work.
This effort will give us all a lot of cool stuff to work with, and will make them easier to work with.
You will probably find that you don't need to dig into the code in
order to port it. You'll have to change the syntax a little (such as
function definitions) and re-code control structures
like if and for. If you run into something
that you're not sure how to port, please ask. This part of the
assignment isn't supposed to be difficult.
When you're done, you'll be able to copy it
to ~cs307/pub/pytw/ which will then be available for
everyone. In the Creative Scene
assignment, you'll make your own contribution as well.
In doing your porting, you mostly just need to convert the C code to Python code, but I'd also like you to do the following:
pydoc jaylmer
Please do the problems in this PDF file: math2.pdf
Written by Scott D. Anderson
scott.anderson@acm.org

This work is licensed under a Creative Commons
License.