Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

Similar documents
For each question, indicate whether the statement is true or false by circling T or F, respectively.

Topics and things to know about them:

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

EXAMINATIONS 2016 TRIMESTER 2

CS 4620 Midterm, March 21, 2017

Computer Science 336 Fall 2017 Homework 2

CS 4620 Midterm 1. Tuesday 22 October minutes

(Refer Slide Time: 00:04:20)

Example Examination 2IV

Viewing with Computers (OpenGL)

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Hidden-Surface Removal.

CS 130 Final. Fall 2015

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

Lesson 1. Unit 2 Practice Problems. Problem 2. Problem 1. Solution 1, 4, 5. Solution. Problem 3

Introduction to Homogeneous coordinates

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

CS 130 Exam I. Fall 2015

4.5 VISIBLE SURFACE DETECTION METHODES

lecture 18 - ray tracing - environment mapping - refraction

CMSC427 Final Practice v2 Fall 2017

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

CS 559 Computer Graphics Midterm Exam March 22, :30-3:45 pm

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

Institutionen för systemteknik

521493S Computer Graphics Exercise 2 Solution (Chapters 4-5)

CS770/870 Spring 2017 Ray Tracing Implementation

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

CSE528 Computer Graphics: Theory, Algorithms, and Applications

(Refer Slide Time 05:03 min)

Unit 1, Lesson 1: Moving in the Plane

CSE328 Fundamentals of Computer Graphics

CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo)

Graphics and Interaction Transformation geometry and homogeneous coordinates

Midterm Exam CS 184: Foundations of Computer Graphics page 1 of 11

The University of Calgary

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

8. Hidden Surface Elimination

CS 130 Exam I. Fall 2015

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

THE VIEWING TRANSFORMATION

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

End-Term Examination

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Linear transformations Affine transformations Transformations in 3D. Graphics 2009/2010, period 1. Lecture 5: linear and affine transformations

Computer Graphics 7: Viewing in 3-D

ECE 600, Dr. Farag, Summer 09

Graphics 2009/2010, period 1. Lecture 8: ray tracing

SUMMARY. CS380: Introduction to Computer Graphics Ray tracing Chapter 20. Min H. Kim KAIST School of Computing 18/05/29. Modeling

Shadows in the graphics pipeline

CS 4204 Computer Graphics

(Refer Slide Time: 00:01:27 min)

Graphics for VEs. Ruth Aylett

BSP Trees. Chapter Introduction. 8.2 Overview

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

SFU CMPT 361 Computer Graphics Fall 2017 Assignment 2. Assignment due Thursday, October 19, 11:59pm

1.1 Pearson Modeling and Equation Solving

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling

You will have the entire period (until 9:00pm) to complete the exam, although the exam is designed to take less time.

A Constant Rate of Change Name Part 1

Course Guide (/8/teachers/teacher_course_guide.html) Print (/8/teachers/print_materials.html) LMS (/8

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CS251 Spring 2014 Lecture 7

(Refer Slide Time: 00:02:24 min)

EXAMINATIONS 2017 TRIMESTER 2

Models and The Viewing Pipeline. Jian Huang CS456

Unit 2: Trigonometry. This lesson is not covered in your workbook. It is a review of trigonometry topics from previous courses.

CS475/675: Computer Graphics End-Semester Examination (Solutions), Fall 2016

Lecture 4. Viewing, Projection and Viewport Transformations

Midterm Exam! CS 184: Foundations of Computer Graphics! page 1 of 14!

Introduction to Computer Graphics with WebGL

Perspective Mappings. Contents

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

Midterm Exam! CS 184: Foundations of Computer Graphics! page 1 of 13!

CEng 477 Introduction to Computer Graphics Fall 2007

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

Werner Purgathofer

Polar Coordinates. 2, π and ( )

Practice problems from old exams for math 233 William H. Meeks III December 21, 2009

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

COMP3421. Vector geometry, Clipping

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Texture Mapping. Texture (images) lecture 16. Texture mapping Aliasing (and anti-aliasing) Adding texture improves realism.

lecture 16 Texture mapping Aliasing (and anti-aliasing)

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

by Kevin M. Chevalier

ALGEBRA 2 W/ TRIGONOMETRY MIDTERM REVIEW

Basics of Computational Geometry

Illumination Models III: Ray Tracing (View Dependent Global Illumination)

More Hidden Surface Removal

Camera Model and Calibration

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

Transcription:

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer The exam consists of 10 questions. There are 2 points per question for a total of 20 points. You may use this cover sheet if you need more space (or ask the prof/invigilator for another exam). LASTNAME, FIRSTNAME: STUDENT ID: Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 TOTAL

1. Consider a 2D space (x, y) whose points are represented using homogeneous coordinates. Give a product of matrices that performs the following. Rotate the scene by θ degrees clockwise around the point (x, y) = (2, 3). That is, the given point stays fixed and all other points are moved. 1 0 2 0 1 3 cos θ sin θ 0 sin θ cos θ 0 1 0 2 0 1 3 The question said clockwise, whereas the examples I gave in the lectures were always counterclockwise. That s the reason why the sign on the sines is different from what you might have expected. (This was not intended to be a trick. Rather, I meant to write counterclockwise.) We ignored the sign reversals on the sine functions in the solution. However, we didn t ignore the signs on the cosine functions! The latter should be positive and we took off a point if you wrote them as negative. Some of you switched the ordering of the translation matrices. We gave only 1.5/2 if you did that. Some of you only had one of the translations. We gave only 1/2 if you did that.

2. Consider the same situation as Q1, but now give a product of matrices that maps a rectangle having opposite corners (1, 3) and (3, 3) to a rectangle having opposite corners (2, 0) and (10, 12). There were several solutions possible. The first solution is to shift the bottom left corner to the origin, then scale so that the rectangle has the desired final dimensions, then translate the bottom left corner to its desired final location. 1 0 2 4 0 1 0 1 0 0 2 0 0 1 3 The second solution that many people gave was first to translate by ( 2, 0). This moves the center of the rectangle to the origin. Then scale by the correct amount. Then translate by (6, 6) which brings the center of the rectangle to the correct position i.e. (6, 6). 1 0 6 0 1 6 4 0 0 0 2 0 1 0 2 0 1 0 A third solution we saw was to scale by the correct amount, and then translate in a way that brings one of the given corners (which has been moved because of the scaling) to its desired position. 1 0 2 0 1 6 4 0 0 0 2 0 A fourth solution was the most difficult to come up with: translate first and then scale. To figure out the translation amount, apply the inverse of the scaling on the two final corner vertices, which maps these vertices back to (0.5, 0) and (2.5, 6), respectively. Then figure out the translation required to bring the original corner points to these positions. That translation is (0.5, 3), giving: 4 0 0 0 2 0 1 0 0.5 0 1 3 As in Q1, some people switched the ordering of the translation matrices. We gave only 1.5/2 if you did that, provided that the matrices were correct. Some people had the idea of combining a translation and a scaling but gave numbers that were calculated incorrectly. We had to make a judgment call in giving points here, since it was typically unclear where the numbers came from. A typical grade in this case was 1/2. Many people wrote their matrices as 4 4 for this question (and for Q1). No marks were taken off for that.

3. Describe how you would obtain a 4 4 projection matrix that maps R 3 to the plane 3x + 2y + z = 1. Assume the center of projection i.e. eye is (0,0,0). You do not need to provide numerical values for the matrix (or matrices), but be sure to specify how you would obtain such values. There were two general approaches to the problem. The first is the one I had in mind. Let R be a rotation that maps the plane normal (3, 2, 1) to the z axis. Such a rotation matrix was given lecture 2 page 4, though in that case that the point p was a unit vector and was mapped to the unit vector ẑ. But its the same idea here. Just let p be the normalized (3, 2, 1) vector. Then, let M be a perspective projection onto the z = 3 2 + 2 2 + 1 plane (lecture 4 page 2.) Finally, rotate back. Thus the solution is R T MR. The second approach was to consider the ray from the origin through point (tx, ty, tz) and ask where it hits the given plane. This is a fine way to think about it and indeed its how we derived the projection matrix in class. The trouble with this approach is that it is trickier to convert that to the solution that I asked for, namely to give a 4 4 projection matrix. But here s how you would do it (and some students did!). The key is to note that the point of intersection is 3tx + 2ty + tz = 1 1 x and so t = 3x+2y+z and the point of intersection is ( 3x+2y+z, in homogenous coordinates as (x, y, z, 3x + 2y + z) and so the projection matrix is 1 0 0 0 0 1 0 0 0 3 2 1 0. For the first solution we gave 1.5/2 if you forgot to rotate back. y 3x+2y+z, z 3x+2y+z ) which can be written For the second solution, we gave part marks if you found the point of intersection but didn t provide the matrix. The number of part marks was a judgment call. One final comment: The question mentions center of projection but it did not explicitly say perspective projection. Some students used orthographic projection instead. We did not penalize for this mistake since the question could have been more explicit.

4. Consider the projective transformation: f 0 0 0 0 0 f 0 0 0 0 0 f 0 + f 1 f 0 f 1 0 (a) Which points in R 3 get mapped to points at infinity? (b) Which points at infinity get mapped to points in R 3?. (a) The plane z = 0 gets mapped to infinity. To see this, multiply the matrix by (x, y, z, 1) and examine the 4th coordinate. For the point to be mapped to infinity, the 4th coordinate should be 0, namely 0x + 0y + 1z = 0, or z = 0. Thus, points on the plane z = 0 get mapped to points at infinity. (b) A general point at infinity (x, y, z, 0) gets mapped to (f 0 x, f 0 y, (f 0 + f 1 )z, z). By inspection, all points at infinity get mapped to R 3, except those points at infinity for which z = 0. The points get mapped to other points at infinity. For (a) we gave either 0/1 or 1/1. For (b), we gave 0.5/1 if you wrote all points at infinity get mapped to R 3, but neglected z = 0.

5. How could bounding volumes be used to speed up clipping? At what stage of the pipeline should this clipping occur? Justify your answer. The bounding volume would be tested against the clipping planes, i.e. the boundaries of the view volume. If the bounding volume lies outside the view volume, then all the surfaces inside the bounding volume must lie outside the view volume too (trivial rejection). If the bounding volume lies entirely within the view volume, then all surfaces must lie in the view volume too (trivially accept). If the bounding volume partly intersects the view volume, then there s not much you can say and you would need to expand the bounding volume (to sub-bounding volumes or to surfaces). As for when this clipping should be done... here are two arguments that are both good. On the one hand, if the entire bounding volume can be rejected/clipped, then this should be done as early as possible, namely before the objects in the bounding volume vertices are sent into the pipeline. i.e. it can be done by CPU. That way, you don t send the complex object through the pipeline if you don t need to. (Also, note the bounding volume is chosen to have a simple shape. The projective mapping would likely make this a more complex shape.) On the other hand, if you could argue that this check should be done at the usual place where clipping is done. If the bounding volume were entirely in the view volume, then all surfaces within the bounding volume would be entirely within the view volume as well. Thus, if you can trivially accept the whole bounding volume, then you can trivially accept all of its surfaces too. One might even argue that a combination of both would be best. Do the checking for trivial rejection before the pipeline (in CPU) and do the checking for trivial acceptance at the clipping stage. Since this was an open book exam, we didn t give any points to you if you just stated what bounding volumes are an how they are used in ray casting. Why not? Because the question isn t about ray casting, but rather it is about clipping. We gave 1/1 if you explained that the bounding volume (not just a vertex!) needs to be tested against the clipping planes i.e. view volume boundaries, and you argued about trivial acceptance or rejection of the bounding volume. For the pipeline location, if you just said essentially that clipping happens at the clipping stage but you gave no further explanation, then we gave 0/1 only unless your answer in the first part indicated that you understood. Several of you said clipping should be done at the vertex stage of the pipeline. We generally gave the point for this if the argument made sense. However, note that the vertex stage typically refers to the coordinate transformations only. It is the first stage of processing on the graphics card (GPU), but alot happens before the vertex stage, namely the CPU can do alot of work before sending anything to the graphics card.

6. Claim: If a scene contains quadric surfaces, then the depth buffer method (hidden surface removal) can only be applied if these quadric surfaces are first discretized into polygons. Is this claim true or false? Briefly explain. False. The depth buffer method just needs to test, for each pixel, whether the object is visible at that pixel. For quadric surfaces, this test can be done for each pixel by solving a quadratic equation. You don t need to approximate the quadric with polygons. If you just quoted the algorithm in the lecture notes where it says to loop over each polygon, then you would answer TRUE. However, the algorithm works fine if you change it to object instead of polygon. There is nothing about the algorithm that requires it to be polygon. As long as you can figure out if a pixel lies in the projection of the object, then the algorithm works fine. That is certainly the case with quadrics, as you can see from the ray casting lecture where I showed how to intersect a ray with a quadric. Most of you got either 0/2 or 2/2 on this one. There wasn t much middle ground in the answers, and explanations were typically very brief.

7. (a) Construct a BSP tree for a 2D scene below. For each subtree, choose the edge from the list in alphabetical order. In particular, the root of the tree is edge a. (b) What is the order of edges drawn for a viewer that is located between edges a and b? (Ignore back face culling.) (a) (b) The order of edges drawn is d, e, a, c, b. 8. Consider an equilateral triangle. Partition it into four equilateral subtriangles as sketched below. Then delete the central subtriangle leaving three subtriangles. Repeating this recursively, infinitely many times, gives a fractal. (a) Show that the surface area of this fractal is 0. (b) Give an expression for the dimension of this fractal. Hint: C = S D (a) Assume that the original triangle has unit area. Then removing the central triangle leaves area 3 4. Removing the central triangle of each of these leaves area ( 3 4 )2. After n levels, area is ( 3 4 )n which goes to 0 as n. (b) C = 3, S = 2, so D = log 3/ log 2.

9. Suppose you would like to fit a cubic curve p(t) = (x(t), y(t), z(t)) to two given 3D points p(0) and p(1) and suppose p (1) and p (1) are also given. That is, you are given the positions at t = 0 and 1 and you are given the first and second derivatives at t = 1. Show how to find the coefficients of this cubic curve. p(t) = = a x b x c x d x a y b y c y d y a z b z c z d z t 3 t 2 t 1 Taking derivatives with respect to t and substituting t = 0 and t = 1 gives: a x b x c x d x [ p(0) p(1) p (0) p (0) ] = = a y b y c y d y a z b z c z d z 0 1 3 6 0 1 2 2 0 1 1 0 1 1 0 0 Right multiplying by the inverse of the 4 4 matrix on the right side gives the coefficients. 10. Simplify the mesh below by collapsing the edge EC onto vertex C. Draw the simplified mesh. Is it possible to have more edge collapses and also to maintain the overall square shape? If so, which edges can be collapsed (and onto which vertices)? One vertex, one edge, and two faces are lost. Yes, AB can be collapsed to A (and D can be collapsed to A). Similarly, H can be collapsed to I (and F can be collapsed to I).