Due in class Sep 26 2008
- Assume that you have a model coordinate space with corners
(100,200) and (1100,2200). You wish to map points in it to a
window with corners (0,0) and (1,1). (600,1200) should map
to (0.5,0.5). X and Y should scale the same. Compute what
the transformations for X and Y should be, in this form:
X' = s X + dx
Y' = s Y + dy I.e., tell me what s, dx, and dy are. - Here are 2 points: (1,2) and (3,7). What is the vector from the first to the second point?
- Here are two parametric lines:
P = (4,0) + a (1,0)
Q = (1,3) + b (0,2) a and b are parameters. Where do the 2 lines intersect? Give the point and the 2 parameters (a and b). - Here are 3 points on a plane: (0,0,0), (1,1,1), (5,3,2). Give a parametric equation for that plane.
- Compute a normal vector to that plane.
- Here is a plane equation: P = (2,2,3) + a(0,1,0) + b(1,1,0). a and b are parameters. Here is a line equation: Q = (0,1,2)+c(0,1,1). c is a parameter. Where do the line and the plane intersect? Give the point and the 3 parameter values.
- Here are 3 vertices of a 2-D triangle: A(1,0), B(2,1),
C(1,3). A parametric equation for points in the triangle ABC
is this: P = aA + bB + cC. a, b, and c are
parameters. a+b+c=1. a>=0. b>=0. c>=0.
Find the values of a,b,c for these points:
- A
- the midpoint of BC
- the centroid of ABC
- Curtis Priem is an RPI grad who founded NVIDIA and who is
now on RPI's Board of Trustees. He has been a generous
benefactor of RPI. He has about 200 patents worldwide.
- Check the subjects of Priem's US patents, and briefly comment on the distribution of patents by subject.
- Pick a graphics-related patent, and summarize it in 100 words or so. Use your words; don't just copy the patent.
- This question is postponed until the next homework.
Extend the paint program presented in class as follows.
- Add 3 more colors of your choosing.
- Add a main menu entry and submenu to enable or disable writing with XOR instead of with copy.
- Add an entry to the permanent menu on the top to draw a circle; the user selects opposite ends of a diameter.
- Modify the program to keep drawing primitives until you select something else from the top menu. That is, after you click on line, each pair of future clicks causes another line. (Now the program ignores left clicks after the first 2 until you again select something on the top menu.)
- Modify the program to use a display list, so that the objects are redrawn when you redisplay the window. (This may be surprisingly hard.)
- Why does paint.c contain this line: y=wh-y;