Homework 2 for Computer Graphics I DUE: Wednesday, October 13, 2004

To do the following exercises, you will need to down load the data directory as well as the executables projection and transformation from the SIGGRAPH Tutorial directory in my public directory, i.e., from /usr/local/pub/ncs/graphics/OpenGL/SIGGRAPHTutorials/. Executables that execute on PC's are availabe from http://www.cs.rit.edu/usr/local/pub/ncs/graphics/OpenGL/SIGGRAPHTutorials/PCExecutables/.

Notes:

1. If you are planning to execute these programs on your home machine, make sure that you also download the data directory AND its contents. For PC users, it is probably easiest to download the zip file.
2. While it is possible to experiment with models other than the ones that first come up with these tutorials, you'll find that some are better than others for doing this work. The ones that come up work well.

Hand in a typed (word-processed) pages answering the following questions: (Start with this file - http://www.cs.rit.edu/~ncs/Courses/570/answers2.txt.) Please use graphics terminology such as translation, scale, and rotation, and if rotation, about which axis and whether clockwise or counterclockwise. If the images did not change as you expect, hypothesizing why would be helpful to you.

Part 1 - Transformations

Use your experimentation with the SIGGRAPH tutorial on transformations and your textbook to answer the following questions: (BE SURE to reset the parameters between each question to isolate the cause and effects. This can be done using the menu that appears if the right mouse button is held down while over the textual area or by typing "r".)

With Parallel Projection (default, select glOrtho from the menu or type "o")

1. How does the image change if you change the x argument of the translate parameter list to negative? to positive?
2. How does the image change if you change the y argument of the translate parameter list to negative? to positive?
3. How does the image change if you change the z argument of the translate parameter list to negative? to positive?
4. How does the image change if you change the angle argument of the rotation parameter list to negative? to positive? (rotation about the Y axis)
5. How does the image change if you change the angle argument of the rotation parameter list to negative while the rotate about vector is set to (0.0, 0.0, 1.0)? to positive? (rotation about Z axis)
6. How does the image change if you change the angle argument of the rotation parameter list to negative while the rotate about vector is set to (1.0, 0.0, 0.0)? to positive? (rotation about X axis)
7. How does the image change if you change the angle argument of the rotation parameter list to negative while the rotate about vector is set to (1.0, 1.0, 1.0)? to positive?
8. How does the image change if you make the x scale factor smaller? larger?
9. How does the image change if you make the y scale factor smaller? larger?
10. How does the image change if you make the z scale factor smaller? larger?
11. Rotate the car so that you can see the entire side of the car and then reanswer the last question.
12. Using glTranslatef( 0.1, 0.1, -.5) and glRotatef(30.0, 0.0, 0.0, 1.0), what, if any difference do you see in the resulting image, if the order of these two commands is swapped? (See right mouse button menu or type "s".)

With Perspective Projection (select gluPerspective from the menu or type " p")

1. How does the image change if you change the x argument of the translate parameter list to negative? to positive?
2. How does the image change if you change the y argument of the translate parameter list to negative? to positive?
3. How does the image change if you change the z argument of the translate parameter list to negative? to positive?
4. How does the image change if you change the angle argument of the rotation parameter list to negative? to positive? (rotation about Y axis)
5. How does the image change if you change the angle argument of the rotation parameter list to negative while the rotate about vector is set to (0.0, 0.0, 1.0)? to positive? (rotation about Z axis)
6. How does the image change if you change the angle argument of the rotation parameter list to negative while the rotate about vector is set to (1.0, 0.0, 0.0)? to positive? (rotation about X axis)
7. How does the image change if you change the angle argument of the rotation parameter list to negative while the rotate about vector is set to (1.0, 1.0, 1.0)? to positive?
8. How does the image change if you make the x scale factor smaller? larger?
9. How does the image change if you make the y scale factor smaller? larger?
10. How does the image change if you make the z scale factor smaller? larger?
11. Rotate the car so that you can see the entire side of the car and then reanswer the last question.
12. Using glTranslatef( 0.1, 0.1, -.5) and glRotatef(30.0, 0.0, 0.0, 1.0), what, if any difference do you see in the resulting image, if the order of these two commands is swapped? (See right mouse button menu or type "s".)

Part 2 - Projections

Use your experimentation with the SIGGRAPH tutorial on projections and your textbook to answer the following questions: (BE SURE to reset the parameters between each question to isolate the cause and effects. This can be done using the menu that appears if the right mouse button is held down while over the textual area or by typing "r".)
• For Perspective Projection using gluPerspective:
1. How does the image change if you make the fovy argument of the gluPerspective parameter list smaller? larger?
2. How does the image change if you make the aspect argument of the gluPerspective parameter list smaller? larger?
3. How does the image change if you make the zNear argument of the gluPerspective parameter list smaller? larger?
4. How does the image change if you make the zFar argument of the gluPerspective parameter list smaller? larger?
5. How does the image change of the x component of the eye triplet is made larger? smaller?
6. How does the image change of the y component of the eye triplet is made larger? smaller?
7. How does the image change of the z component of the eye triplet is made larger? smaller?
8. How does the image change of the x component of the center triplet is made larger? smaller?
9. How does the image change of the y component of the center triplet is made larger? smaller?
10. How does the image change of the z component of the center triplet is made larger? smaller?
11. How does the image change of the x component of the up triplet is made larger? smaller?
12. How does the image change of the y component of the up triplet is made larger? smaller?
13. How does the image change of the z component of the up triplet is made larger? smaller?

• For Perspective Projection using glFrustum
1. How does the image change if the left parameter of the glFrustum call is made larger? smaller?
2. How does the image change if the right parameter of the glFrustum call is made larger? smaller?
3. How does the image change if the bottom parameter of the glFrustum call is made larger? smaller?
4. How does the image change if the top parameter of the glFrustum call is made larger? smaller?
5. How does the image change if the near parameter of the glFrustum call is made larger? smaller?
6. How does the image change if the far parameter of the glFrustum call is made larger? smaller?
7. Do the gluLookAt parameters affect the image in the same way using glFrustum as they do using gluPerspective? If not, in what way do the causes and effects differ?
8. Why do the zNear and zFar parameters have different effects on the image when using glFrustum and gluPerspective?

• For Parallel or Orthographic Projection:
1. How does the image change if the left parameter of the glOrtho call is made larger? smaller?
2. How does the image change if the right parameter of the glOrtho call is made larger? smaller?
3. How does the image change if the bottom parameter of the glOrtho call is made larger? smaller?
4. How does the image change if the top parameter of the glOrtho call is made larger? smaller?
5. How does the image change if the near parameter of the glOrtho call is made larger? smaller?
6. How does the image change if the far parameter of the glOrtho call is made larger? smaller?
7. Which of the following has a different effect in parallel projection than it does in perspective projection? If the effect is the same, indicate so. If it is different, tell how.
• How does the image change of the x component of the eye triplet is made larger? smaller?
• How does the image change of the y component of the eye triplet is made larger? smaller?
• How does the image change of the z component of the eye triplet is made larger? smaller?
• How does the image change of the x component of the center triplet is made larger? smaller?
• How does the image change of the y component of the center triplet is made larger? smaller?
• How does the image change of the z component of the center triplet is made larger? smaller?
• How does the image change of the x component of the up triplet is made larger? smaller?
• How does the image change of the y component of the up triplet is made larger? smaller?
• How does the image change of the z component of the up triplet is made larger? smaller?

• For all types of projections:
1. The three triplets of the gluLookAt call specify which coordinate system?
2. The eye triplet represents what in this coordinate system?
3. The center or point to triplet represents what in this coordinate system?
4. The up triplet represents what in this coordinate system?
5. Which entity does gluPerspective, glFrustum, and glOrtho specify?
6. What is the main difference between parallel and perspective projection?

Nan C. Schaller
Rochester Institute of Technology
Computer Science Department
102 Lomb Memorial Dr.
Rochester, NY 14623-5608
telephone: +1.585.475.2139
fax: +1.585.475.7100
e-mail: ncs@cs.rit.edu
January 7, 2003
http://www.cs.rit.edu/~ncs/Courses/570/homework1.html