Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Midterm Exam with Solutions - Computer Graphics | SOCC 167, Exams of Introduction to Sociology

Material Type: Exam; Class: Science and War; Subject: Computer Science & Engineering; University: University of California - San Diego; Term: Winter 2003;

Typology: Exams

2009/2010

Uploaded on 03/28/2010

koofers-user-43k
koofers-user-43k 🇺🇸

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Midterm Exam: Solutions
CSE 167, Winter 2003
Date: 2/14/2003
Questions:
1. Given the following code, find the current Modelview matrix as a set of
matrix multiplications. (You don’t have to actually multiply the matrices)
glMatrixMode(GL_MODEL_VIEW);
glLoadIdentity();
glTranslatei( 5, 2, 1 );
glRotatef( 1.0f, 0.0, 0.0, 1.0f );
1000
1100
20)180/cos()180/sin(
50)180/sin()180/cos(
ππ
ππ
pf3
pf4
pf5

Partial preview of the text

Download Midterm Exam with Solutions - Computer Graphics | SOCC 167 and more Exams Introduction to Sociology in PDF only on Docsity!

Midterm Exam: SolutionsCSE 167, Winter 2003

Date: 2/14/

Questions:

1. Given the following code, find the current Modelview matrix as a set of matrix multiplications. (You don’t have to actually multiply the matrices)

glMatrixMode(GL_MODEL_VIEW);glLoadIdentity();

glTranslatei( 5, 2, 1 );glRotatef( 1.0f, 0.0, 0.0, 1.0f );

cos(sin(ππ// 180180 )) cos(sin( ππ// 180180 )) 00 25

2. Suppose a triangle in object coordinates is represented by the following threepoints ( each point has the format: (x,y,z)):

P0: ( 1, 5 , 10 )P1: ( 3, 21, 10 )

P2: ( 5, -5, 10 )

Find a combination of transformations that will represent the triangle by thefollowing points in world coordinates:

P0’ : ( -1, 6, 13 )P1’: ( 3, 14, 13 )

P2’: ( 7, 1, 13 )

Write the transformation as a series of matrix multiplications in the correctorder. (You don’t have to actually do the multiplication)

Recognize that the problem is asking:Find the matrix such that the following is true

61 eai bfj kgc hdl and eai bfj kgc dhl and aei bfj kgc dh l

Step 1:The last transformation is a z-translation by 3. Remove z-translationby subtracting the constant difference between z-values from P0’,P1’,P2’

Now the problem is as follows.



 

 

 

− 

 

 

 

 

 

 

 

=^  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=^  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=^  

 

 

 

− (^101)

(^55) 00 00 01 13 0 0 0 1

01 10 00 00 (^131) 17 (^101) 213 00 00 01 13 0 0 0 1

01 10 00 00 (^131) 143 (^101) 51 00 00 01 13 0 0 0 1

01 10 00 00 (^131) 61 aie bfj kgc hdl and eai fbj kgc hdl and eai bfj kgc d lh or 

 

 

 

− 

 

 

 

=^  

 

 

 

 

 

 

 

 

 

 

 

=^  

 

 

 

 

 

 

 

 

 

 

 

=^  

 

 

 

− (^101)

(^55) (^1010001) 17 (^101) 213 (^1010001) 143 (^101) 51 (^1010001) 61 eai bfj kgc dlh and eai bfj kgc dlh and eai bfj kgc hd l

Step 2: Graph out the two triangles (after removing translation), note thatthis is now a 2-D problem because both triangles are on the same z-plane.

02.^050000

02.^050000

02.^050000

3. a. Orthogonal projection of PO:(-1,6,13), P1:(3,14,13), P2(7,1,13):

Use diagrams below, but need to first translate such that COP is at (0,0,-4), calculateb. Perspective projection w/ COP at (1,1,-4)

projected coordinates, and then translate back.Answers:

(x, z)

z

x

(xp, zp=-3)

z^ x /^ 1 = x^ p Y

(yp, zp=-3) z

z^ y /^ 1 = y^ p

(y, z)