You are on page 1of 3

Written Assignment #1 Solution

15-462 Computer Graphics, Spring 2008

1) Draw a standard computer graphic pipeline. Briefly discuss the functionality of each part.

Application

Texturizing
Data

Polygon Polygon Data Graphics Card


Meshes
Vertex Data
Vertices of Rasterization and Image
Transformation
Polygon lighting Assembly

View
Description

Lighting
Display
Data

Application used to collect all necessary data to create the scene


Texturizing data provide texture information
Polygan meshes the primitive elements/units to build the entire object, usually triangles
Vertices for polygon meshes store all vertices of each polygon
View description information to set up the scene, like the camera position, project information, etc.
Lighting data all about light information, such as the light position, color, intensity, etc.
Transformation transform vertices based on the camera position, view angle, etc.
Rasterization and lighting convert all information into pixels with given light information
Image assembly integrate all information together to generate 2D image
Display display the colored pixels on screen.

2) The direction of the light source has been given as L. Given the vertex of object P(x, y, z), calculate the
projection p(x, y, z), where y = 0.
y = 0; Similar with the example covered in the chapter three, we can simply limit the 3D coordinates in a 2D
plane and solve the simple geometry correspondingly.
Since
(x x) / (y y) = lx / ly
(z z) / (y y) = lz / ly
we can get the final vertext of P as follows:
P(x y (lx / ly), 0, z y (lz / ly))

3) Give two vectors A = [-3, 4], B = [2, 3], calculate the inner product and the cross product. Calculate the
angle too.

Though the vectors are represented in a 2D form, we should expand them to 3D space before calculating the
inner and cross product.
A B = 6
A B = 0i + 0 j 17k

A = ( 3) 2 + 4 2 + 0 2 = 5

B = 2 2 + 32 + 0 2 = 13

A B
sin( ) =
AB

= 70.560

4) Find the parameterized equation form for


a) A line intersecting the x-axis at 5 and intersecting the y-axis at 8, parameterized upward

[x, y] = (1-t)[5, 0] + t[0, 8] = [5, 0] + t[-5, 8]

x2 y2
b) The ellipse + = 1 , parameterized counter clockwise
16 25

[x, y] = [4 cos( ) , 5 sin( ) ]


5) What are the barycentric coordinates where the ray (1, 1, 1) + t(-1, -1, -1) hits the triangle with vertices (1,
0, 0), (0, 1, 0) and (0, 0, 1)

The normal of this triangle is n = [1, 1, 1]. Since the equation of a plane is n p + d = 0 for all p on the

plane. Since (0, 0, 1) is on the plane, we got d = -1.

([1,1,1] + t[ 1,1,1]) [1,1,1] = 1 , we get t = 2/3. So the line intersects the plane at (1/3, 1/3, 1/3). Put them

into the barycentric expression, we finally get = = = 1/ 3

6) Prove the following operators are linear transformation or not

a) T ( x ) = sin(2 x )

sin( 2( ax1 + bx 2 )) = sin( 2ax1 + 2bx 2 ) 2a sin( x1 ) + 2b sin( x2 )


Non-linear

b) T ( x ) = log( x / 3)

log((ax1 + bx 2 ) / 3) = log(ax1 / 3 + bx 2 / 3) ( a / 3) log( x1 ) + (b / 3) log( x 2 )


Non-linear
T
c) A , where A is a matrix

( aA1 + bA2 ) T = aA1T + bA2T


Linear

7) Describe what the following matrix does


0 1 0 0
1 0 0 0

0 0 1 0

0 0 0 1
This matrix flips every point from one side to the other side along the plane y = x ;

8) Provide a transformation matrix to do the following job. Rotate the object by degree , then scale x by 1/3
and scale y by 2.

1 / 3 0 cos sin
0 2 sin cos

You might also like