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

Introduction to Computer Graphics - Solved Midterm Exam 1 | CS 4810, Exams of Computer Graphics

Material Type: Exam; Professor: Brogan; Class: Introduction to Computer Graphics; Subject: Computer Science; University: University of Virginia; Term: Spring 2004;

Typology: Exams

Pre 2010

Uploaded on 07/29/2009

koofers-user-mog
koofers-user-mog 🇺🇸

3

(1)

10 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to Computer Graphics
Midterm Examination
Professor Brogan
Name:____________________________
Honor Pledge: This is a closed-book, closed-notes, independent exam. Please sign the
honor pledge: On my honor as a student, I have neither given nor
received information on this exam. Signed, ______________________
Display Technology
1) What is a scanline?
A row of pixels on a raster display. Somewhat true to call a row of pixels
in the frame buffer a scanline.
2) Frame buffers are described as having a certain depth. To what does the depth
refer?
The number of bits used to store the color for each pixel.
3) What is stored in the frame buffer when a color map lookup table is used?
A number that corresponds to an index into the color map lookup table.
The lookup table is an array of color descriptions (RGB). For example,
index 0 could refer to the color BLACK, while the index 1 could refer to the
color SKY_BLUE. The colors in the color map are reconfigurable.
4) What is a shadow mask?
A shadow mask is a perforated metal sheet that between the electron gun
and the phospher coating on the screen. The shadow mask serves to
sharpen the RGB beams that are emitted from the guns.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Introduction to Computer Graphics - Solved Midterm Exam 1 | CS 4810 and more Exams Computer Graphics in PDF only on Docsity!

Introduction to Computer Graphics Midterm Examination Professor Brogan

Name:____________________________

Honor Pledge: This is a closed-book, closed-notes, independent exam. Please sign the honor pledge: On my honor as a student, I have neither given nor received information on this exam. Signed, ______________________

Display Technology

  1. What is a scanline?

A row of pixels on a raster display. Somewhat true to call a row of pixels in the frame buffer a scanline.

  1. Frame buffers are described as having a certain depth. To what does the depth refer?

The number of bits used to store the color for each pixel.

  1. What is stored in the frame buffer when a color map lookup table is used?

A number that corresponds to an index into the color map lookup table. The lookup table is an array of color descriptions (RGB). For example, index 0 could refer to the color BLACK, while the index 1 could refer to the color SKY_BLUE. The colors in the color map are reconfigurable.

  1. What is a shadow mask?

A shadow mask is a perforated metal sheet that between the electron gun and the phospher coating on the screen. The shadow mask serves to sharpen the RGB beams that are emitted from the guns.

Mathematical Foundations

  1. Given two points, (a, b) and (c, d), provide the following equations of a line:

Slope-intercept: y = mx + intercept m = (d-b) / (c-a) intercept: Substitute a for x and b for y (or c for x and d for y) b = [(d –b) / (c – a)] * a + intercept intercept = b – a * [(d-b) / (c-a)]

Parametric: x = a + t (c-a) y = b + t (d-b)

  1. Provide a geometric (use a picture) and an algebraic definition of the dot product of two vectors, [u (^) x, u (^) y, u (^) z] and [v (^) x, vy, vz]

Algebraic:

ux vx uyvy uzv z

u v uv = + +

  • = cosΘ

Geometric: Two vectors define a plane Here, we’ve aligned the defined plane with the paper v

Θ u uv

  1. What is an orthonormal matrix?

A matrix is orthonormal if: The row and column vectors have unit length The row and column vectors are pairwise orthogonal (their dot product is 0)

  1. Compute the inverse of the following orthonormal matrix:

1

Rasterization

  1. Given two integer endpoints for a line, and the following rasterization algorithm:

public void lineSimple(int x0, int y0, int x1, int y1, Color color) { int pix = color.getRGB(); int dx = x1 - x0; int dy = y1 - y0;

raster.setPixel(pix, x0, y0); if (dx != 0) { float m = (float) dy / (float) dx; float b = y0 - mx0; dx = (x1 > x0)? 1 : -1; while (x0 != x1) { x0 += dx; y0 = Math.round(mx0 + b); raster.setPixel(pix, x0, y0); } } }**

a) Describe a case where the algorithm will poorly render a line between the two points.

When the slope of the line is greater than 1.0.

  1. One triangle rasterization technique is called Edge Equations. List three optimizations implemented in the following two code segments:

findBoundingBox(&xmin, &xmax, &ymin, &ymax); setupEdges (&a0,&b0,&c0,&a1,&b1,&c1,&a2,&b2,&c2);

for (int y = yMin; y <= yMax; y++) { for (int x = xMin; x <= xMax; x++) { float e0 = a0x + b0y + c0; float e1 = a1x + b1y + c1; float e2 = a2x + b2y + c2; if (e0 > 0 && e1 > 0 && e2 > 0) setPixel(x,y); } }**

findBoundingBox(&xmin, &xmax, &ymin, &ymax); setupEdges (&a0,&b0,&c0,&a1,&b1,&c1,&a2,&b2,&c2); float e0 = a0x + b0y + c0; float e1 = a1x + b1y + c1; float e2 = a2x + b2y + c2; int xflag = 0; for (int x = xMin; x <= xMax; x++) { if (e0|e1|e2 > 0) { setPixel(x,y); xflag++; } else if (xflag != 0) break; e0 += a0; e1 += a1; e2 += a2; }**

  1. Removed explicit line equation calculation inside the loop. Replaced with discrete difference equation. Removes multiplies

  2. Condition check simplified to bitwise OR and one zero- comparison

  3. xflag allows for early termination when end of line is reached

  4. Nested for loops reduced to one for loop

Geometric Transformations

  1. Why do we use a 4x4 homogenous coordinate transformation matrix when describing translations, rotations, and scales, etc.?

A 4x4 homogeneous transformation matrix allows rotation and translation transformations to be unified in one matrix representation. This facilitates concatenation of rotations, scales, translations, etc. Use of the homogeneous coordinate in the lower-right corner of the 4x4 matrix facilitates perspective and parallel projection calculations.

  1. Provide a 3x3 matrix that will compute the new vertices of a planar house centered at [10, 5] after a rotation of 90 degrees about its center:

First, translate house to (0,0). Then rotate 90 degrees. Then translate house back to (10,5).

sin 90 cos 90 0

cos 90 sin 90 0

  1. (Worth double points) Calculate a 4x4 matrix that rotates points about the vector A = [1, 1, 1] by 90 degrees. Show your work.

Rotate about y-axis –45 degrees to bring vector into YZ plane Rotate about x-axis 45 degrees to bring vector onto z-axis Rotate about z-axis by 90 degrees Unwrap x-rotation Unwrap y-rotation

Note: Right-handed coordinate system specifies that positive rotations are Counter-Clockwise (CCW) when looking from the positive axis towards the origin

sin( 45 ) 0 cos( 45 ) 0

cos( 45 ) 0 sin( 45 ) 0

0 sin( 45 ) cos( 45 ) 0

0 cos( 45 ) sin( 45 ) 0

sin( 90 ) cos( 90 ) 0 0

cos( 90 ) sin( 90 ) 0 0

0 sin( 45 ) cos( 45 ) 0

0 cos( 45 ) sin( 45 ) 0

sin( 45 ) 0 cos( 45 ) 0

cos( 45 ) 0 sin( 45 ) 0

  1. Calculate y’ in the following figure

d

y z

y

z

yd y ′=

  1. The 4x4 perspective projection matrix, M (^) per , converts points from the camera coordinate system to the view plane coordinate system. It performs the calculation from the previous question. What is the 4x4 matrix, M (^) per?

d

Color and Light

  1. What is the name of the region of the retina where our vision is the sharpest?

Fovea

  1. What color are we the least sensitive to? Red, Green, or Blue

Blue

  1. Why do monitors need to perform gamma correction?

The perceived intensity (brightness) of a pixel is not linearly related to gun voltage.

  1. If you were an artist, trying to carefully color polygons by hand, which color space would you prefer to work in, RGB or HSV? Why?

d

P ( x, y, z )

y

Z

View

plane

y’ =?

I would pick HSV because it is intuitive to select a first select a hue and subsequently pick a saturation and a value. RGB, by contrast, is more difficult to tinker with. Blending between two different colors in RGB space is not as easily accomplished as when blending between two HSV values.

  1. Given: an incoming light intensity, I a surface normal, N a vector from the surface to the light source, L a vector from the surface to the viewer’s eye, V specular constant, ks define the intensity of the light reaching the viewer as a result of the specular effects of the Phong lighting equation. Your definition may only use these variables. I (^) viewer = ks I (^) light (cos(φ)) n I (^) viewer = ks I (^) light (V ●R) n R = 2 (N ● L) N – L

  2. Both Gouraud and Phong Shading interpolate along polygon edges to compute intensities. But the two shading models interpolate different things.

a) What does Gouraud Shading interpolate along edges?

Color / Intensity of the vertices at the edge endpoints.

b) What does Phong Shading interpolate along edges?

Vertex normals of the edge endpoints.

  1. True or False? Raytracing produces viewer-independent lighting solutions.

False

  1. True or False? Radiosity produces accurate specular highlights

False

  1. (Extra Credit) Who is credited with inventing The Rendering Equation?

Jim Kajiya