CSC 418/2504 Winter 2002 Assignment 1: Frequently asked
- Question 1.
- Question 2.
- Question 3.
- Question 4.
- Question 5.
- Q: What sorts of answers do you want?
A: What have you seen in computer-generated animations that tips
you off it's not real?
- Q: What are spherical coordinates?
A: The textbook has the formulas. See page 830,831.
- Q: Are the sniper shots and the laser beam the same?
- A: No!! the laser beam is important for the parts a and b of
the question. For parts c and d there is sniper somewhere with
a gun who hits the ball with three shots. It is not important where the
sniper is so you can place the gun whereever you please. The only info. you
are given is that all three shots hit the ball. The direction in which the
ball is rotating in c is also not important!
- Q: How come there's only one value per pixel? I thought
there were three: R,G,B.
True. Assume this is a gray-scale (black and white) image, so
each pixel just has a brightness, but no colour.
mini-faq that tells
you how to upload your programs to CDF when you're done.
- Q: The code doesn't compile!
Sorry. CDF improved the compiler. Download it again. It
should compile now.
- Q: How can I run CDF programs on MY machine?
A: There's a
A2: There are also brief
instructions on how to run a program on CDF and have the
graphics appear on your screen.
Q: What parts of the text deal with this
A: Section 2.4 (pages 63-67) of the text may help.
Q: Where do I plot the polygon and viewport?
A: There is a comment in the routine display in poly.cpp that
says plot poly and viewport here.
Q: I still don't get it. What are
handleMouseMotion used for?
A: They are called when the user does something with the mouse.
Whenever the user does something, you should update the current
rectangle, and re-draw it.
Your mission (you must decide to accept it if you want marks)
is to build a finite state machine, with states such as "Idle"
or "dragging top left", and transitions such as "left button
down" or "mouse dragged".
- If the user clicks (or releases) a mouse button,
handleMouseAction is called, with info about
which button, where the mouse pointer was, wether it was a
click or a release. This is when you have to figure out
which handle (if any), the user clicked on.
- If the user drags the mouse with a button held down,
handleMouseMotion is called, with the mouse
pointer's current location.
Dept of Computer Science,
University of Toronto