Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
mtans

mtans

Ratings: (0)|Views: 4|Likes:
Published by hemaccna

More info:

Published by: hemaccna on Jun 08, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/08/2010

pdf

text

original

 
CSE 167 - Intro to Computer GraphicsMidterm Examination
November 4, 2004Instructor: Sam Buss, UC San Diego
Write your name or initials on every page before beginning the exam.You have 75 minutes. There are six problems. You may not use calculators,notes, textbooks, or other materials during this exam. You must show yourwork in order to get credit. Good luck!
Name:
Student ID:123456Total
 
Name:
2
1.
As shown in the figure below, an “
F
” placed in standard position at theorigin is transformed by an transformation
A
.
A
is an affine transformationof 
R
2
. The effect of 
A
on the “
F
” can be informally described as follows: The
F
” is translated a distance
from the origin along a line that makes angle
θ
with the
x
-axis. It is then tilted through an angle of 
φ
. (You may notwant to implement the transformation in this way your OpenGL program,however.) Let
drawF()
be a routine that draws the “
F
” in standard position.Use
drawF
and (psuedo)-OpenGL commands to draw the “
F
” as transformedby
A
.
One possible answer:
glMatrixMode(GL MODELVIEW);glLoadIdentity();pglRotate(
θ
);pglTranslate(
,0);pglRotate(
φ
θ
);drawF();
 
Name:
3
2.
Write OpenGL commands thatgenerate a solid “
F
” formed fromthree ellipsoids as in the figure.The three ellipsoids have circu-lar cross sections: their centralcircular cross-sections are circlesof diameter 1 (radius
12
). Thelengths of the three ellipsoids areall different: the endpoints of theellipsoids are as labelled.Write a fragment of an OpenGL program that generates the solid
F
. Use a command
drawUnitSphere()
that draws a sphere oradius one centered at the origin and use OpenGL commandssuch as
LoadIdentity()
,
glTranslatef()
,
glRotatef()
,
gScalef()
,
glLoadMatrix()
,
glMultMatrix()
,
glPushMatrix()
, and
glPopMatrix()
.
Possible answer:
glMatrixMode(GL MODELVIEW);glLoadIdentity();glPushMatrix();glTranslatef(0,2,0);glScalef(0.5,2,0.5);drawUnitSphere();glPopMatrix();glPushMatrix();glTranslatef(1,4,0);glScalef(1,0.5,0.5);drawUnitSphere();glPopMatrix();glPushMatrix();glTranslatef(1.25,2,0);glScalef(0.75,0.5,0.5);drawUnitSphere();glPopMatrix();

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->