Elements of Computer Graphics CS 174, Spring 2002: Assignment 1
Name: ______________________________________
Student ID: _________________________________
Due date: in class, April 17, 2002.
Weight: 15 %.
Collaboration: None. If you discuss this assignment with others you should
submit their names along with the assignment material.
Instructions: Fill in your name and student ID and return this sheet
with your assignment.
- Change of coordinates (7 marks).
Consider the three coordinate systems O, A, B:
Notation: MST is a 3x3 homogeneous matrix that transforms points
from frame S to frame T.
a.
(2 mark) Write the coordinates of P in the three frames.
b.
(1 mark) Express MOB in terms of MOA and MBA.
c.
(1 mark) Express MOB in terms of MBO.
d.
(3 marks) Find MOA, MAB, and MOB and
show your work.
- Transformations (10 marks).
Consider the line segment defined by the points A:(1,1,0) and B:(2,3,0)
in world coordinates
- (1 mark) What are the coordinates of vector AB?
- (1 mark) What are the coordinates of the unit vector along the axis defined
by AB?
- (2 marks) What is the projection of vector AB on the axis (1,1,0)? Give
the vector not just the magnitude.
- (3 marks) What are the cosine and the sine of the angle between vector
AB and the axis (1,1,0)?
- (3marks) What is the inverse of the following matrix:
Exploit the structure of the matrix, and show your work.
- Hardware (3) marks.
- (2 marks) What is the bandwidth required out of a frame buffer for a 1024x1024,
24bit, 60Hz display? Give your answer in megabytes.
- (1 mark) Consider an image that has 512 distinct 24bit colors. The image
is displayed using a framebuffer that uses 8 bits for color. How many colors
are lost at minimum?
- OpenGL (10 Marks).
Write a program in OpengGL that draws the following robot. Use the template
code found at www.cs.ucla.edu/~pfal/courses/cs174/2002s/coursework/.
Instead of the cylinder draw a sphere of radius 1. Use only the two procedures
provided, drawCube() and drawSphere(), and the following OpenGL functions:
glMultMatrixf, glPushMatrix() and glPopMatrix(). Do NOT use glRotatef(), glTranslatef()
and glScalef(). The four parameters theta1, theta2, L and D are read from
the keyboard or a text file.
End of assignment.