Due: Late (*) Friday, Sept 21.
(*) "Late" means that the
instructor might start grading by 8AM Saturday. Once the instructor starts
grading, no more assignments will be accepted.
10 points
This assignment should be done individually
You can do the programming parts of this assignment in any language you like,
although if your results are anomalous, and the grader does not speak the
language you use, they may be less able to quickly figure out what the problem
is and give you reasonable part marks.
Regardless of what language you use, please follow the instructions linked here carefully.
Deliverables
within questions are flagged with ($).
This
assignment has 8 regular questions followed by 3 optional challenge problems
which can be exchanged and/or done for modest bonus points. The first 7
problems are all worth one point, and the 8th is worth 3 points for
a total of 10 points.
a) What is M*(10, 20, 30, 40)? Don’t
forget to explain ($)
b) What is M*(15, 26, 37, 48)? Don’t forget to explain ($)
Provide a picture of shape like the
“house” used in the slides to visualize transformations undergoing a sheer
along X with a=1 and a=2 ($). You may find working with a piece of graph paper
helpful either as a draft, or as the actual result (if you like, you could take
a picture of it with your phone and put this into your document). Regardless of
how you created it, your figure should have a caption that explains what the
sheer does using the figure as an example.
We will represent points at (i,j) with a 21x21 size block of color covering the range of
(i-10:i+10,j-10:j+10). Your program needs to handle points outside the range of
the image. If the box is are near the edge you need to “clip” the parts of the box that are not
visible. If the box is completely outside the image, then you will not show
them at all, but your program needs to remember about them incase some
operation moves them back into the window.
You'll need to re-use this box-drawing code several times in this
assignment, so modular programming practices suggest that you would want to
make it a function. The inputs might be (a) an image to draw into, (b)
the (i,j) coordinate of the box center, and (c) the
RGB triple for the color of the box. The function's output would be the
image with the box drawn into it.
This file
contains the points to draw in terms of (x,y). Create a matrix in homogeneous
coordinates that transforms them to (i,j). Put the
matrix with some explanation as to how you produced it into your writeup
($). Use the matrix to write the boxes
for the points onto your 600x600 white image. Your boxes should be blue.
Include the resulting image in your PDF ($).
a) Create a single matrix in homogenous
coordinates that scales the X values by 3/5 and the Y values by 5/4. Put this
matrix in your writeup with some explanation ($). Transform the points with
this matrix and write them onto the image in green (the blue boxes should be
there also).
b) Create a single matrix in homogenous
coordinates that scales the X values by 3/5 and the Y values by 5/4 as before, and
then rotates them by 30 degrees. Put this matrix in your writeup with some
explanation ($). Transform the points with this matrix and write them onto the
image in cyan (0,255,255) (the previous boxes should be there also).
c) Create a single matrix in homogenous
coordinates that does all the previous operations and also translates them by
the vector (100, -200). Put this matrix in your writeup with some explanation
($). Transform the points with this matrix and write them onto the image in
magenta (255,255,0) (the previous boxes should be there also).
Put the single image with four sets of
points into your write up with an informative caption ($). You will need to
write at least a few sentences, perhaps 5 or 6 of them.
Provide such a matrix in your writeup
(with explanation) ($) as well as the verification that that it is orthogonal
and that it satisfies the mapping requirements ($). You can cut and paste
Matlab output for some of this if you like, but don’t forget explanation.
You will reuse the transformation just found, O, but you will need to promote it to a 3x3 matrix for homogenous coordinates if you have not done so already.
a) Use your orthogonal transformation, O, to provide a single matrix that applies the transformation, O, in (x,y) followed by the mapping to image coordinates on our 600x600 canvas. Put this matrix in your write up with explanation about where it came from ($). Use this matrix to compute the transformed locations of the points from question three. Show these as blocks in red, together with blocks for the original points in blue.
b) Add a scaled (by 30) version of the X and Y unit axes vector segments, as well as the two vectors (-2, 7) and (-7,-2), both drawn as line segments. To do this, first get the scaled and transformed image coordinates, and then get the intermediate points and plot them. To get the intermediate points, you can use someone else’s implementation of Bresenham’s algorithm if you like. A Matlab one that I got from the web with a few tweaks is conveniently copied here. (Remember that if a dot-m file (e.g. bresenham.m) is in your working directory, you should be able to do “help [function]” (e.g., “help bresenham”)). Draw the axes segments should be green, and the two other segments cyan (0,255,255) ($).
c) Finally, using the matrix from (a), and your line drawing capability to draw the rotation of the scaled (by 30) X and Y unit axes vector segments as magenta (255,0,255). Do they end up where you expect? Provide the final image, with an informative caption, to your writeup ($).
The 2D camera shown in this figure is very self-centered. It wants everything in its own coordinate system. Develop a single matrix that transforms points in (x,y) to camera centric coordinates ($). Apply your matrix to the camera axis points (6,12), (4,11), and (7,10) as a check ($). Do this points end up where you expect? Explain ($). Finally compute the camera coordinates for the point with (x,y) coordinates (-5,-9) ($).
Your deliverables ($) should be a PDF with your images with lines drawn on them and an explanation of what you conclude.
For the chandelier image, you must also put small circles (i.e., "dots") that make it clear where the lines come from. In the case of the building, it will be generally clear how you drew the line, but in the case of the chandelier image this will not be the case. Help the grader by showing the points that you are drawing lines through. If you color code the points and/or lines, this will help provide points of reference in your explanation.
Note this assignment requires some judgments about what reasonable deviations from the model are, as well as the accuracy of your line drawings. Good cases can be made in both examples, but you need to be careful and skeptical.
Challenge problems
Challenge problems are not required, but can be exchanged for non-challenge problems, or done for modest extra credit. They provide flexibility for students who are especially interested in the subject, and who are comfortable with their understanding of the basics. They can be difficult and often require some math skills that are not pre-requisite for this course. I recommend being careful about spending too much time on them.
Consult
the instructions linked here for conventions for preparing and handing
in assignments. In 2012, hand in assignments via email to Kyle Simek
(ksimek@email.arizona.edu).