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

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

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

CS 4620 Program 3: Pipeline

Pipeline Operations. CS 4620 Lecture 10

Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers

Rasterization Overview

Computer Graphics. Illumination and Shading

The Rasterization Pipeline

CHAPTER 1 Graphics Systems and Models 3

CS 464 Review. Review of Computer Graphics for Final Exam

CS 130 Final. Fall 2015

CEng 477 Introduction to Computer Graphics Fall 2007

Lecture 4 Advanced Computer Graphics (CS & SE )

CS559 Computer Graphics Fall 2015

Models and Architectures

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Module 13C: Using The 3D Graphics APIs OpenGL ES

CS 130 Exam I. Fall 2015

Graphics and Interaction Rendering pipeline & object modelling

CS4620/5620: Lecture 14 Pipeline

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

lecture 18 - ray tracing - environment mapping - refraction

CPSC / Illumination and Shading

Deferred Rendering Due: Wednesday November 15 at 10pm

Interactive Real-Time Raycasting

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

CS 130 Exam I. Fall 2015

OXFORD ENGINEERING COLLEGE (NAAC Accredited with B Grade) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

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

Computer Graphics I Lecture 11

LIGHTING AND SHADING

Hidden Surfaces II. Week 9, Mon Mar 15

Institutionen för systemteknik

CS451Real-time Rendering Pipeline

CSC 471 midterm 2 Winter Name:

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Rendering Objects. Need to transform all geometry then

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Computer Graphics. Illumination and Shading

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

CS452/552; EE465/505. Intro to Lighting

RASTERISED RENDERING

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

Classic Rendering Pipeline

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

Ciril Bohak. - INTRODUCTION TO WEBGL

CS 184: Assignment 2 Scene Viewer

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

CSE4030 Introduction to Computer Graphics

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

Graphics for VEs. Ruth Aylett

Graphics Hardware and Display Devices

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

Points and lines, Line drawing algorithms. Circle generating algorithms, Midpoint circle Parallel version of these algorithms

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

CS Exam 1 Review Problems Fall 2017

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Visualisatie BMT. Rendering. Arjan Kok

Topics and things to know about them:

Graphics for VEs. Ruth Aylett

Computer Graphics. Shadows

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

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

Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Illumination and Shading

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1

Exercise Max. Points Total 90

E.Order of Operations

Chapter 7 - Light, Materials, Appearance

CIS 581 Interactive Computer Graphics

Computer Graphics. Instructor: Oren Kapah. Office Hours: T.B.A.

Turn on the Lights: Reflectance

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

Computer Graphics: Programming, Problem Solving, and Visual Communication

Homework 3: Programmable Shaders

CS 354R: Computer Game Technology

Methodology for Lecture. Importance of Lighting. Outline. Shading Models. Brief primer on Color. Foundations of Computer Graphics (Spring 2010)

9. Illumination and Shading

Shadows. COMP 575/770 Spring 2013

CS 481/681 Advanced Computer Graphics, Spring 2004 Take-Home Midterm Exam

Computer Graphics Introduction. Taku Komura

Shading and Texturing Due: Friday, Feb 17 at 6:00pm

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Transcription:

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions The Midterm Exam was given in class on Thursday, October 23, 2008. 1. [4 pts] Drawing Where? Your instructor says that objects should always be drawn with their natural center at the origin. Why? And if we do this, how do we indicate where an object is to appear in the scene? We draw with the natural center at the origin so that we can easily rotate and scale the object, using rotation and scale transformations, without changing its location. We then position the object using a translation transformation. 2. [7 pts total] Animation & Buffers. When we do real-time animation, we usually do a certain trick with the framebuffer(s). 2a. [5 pts] What is this trick called, and what exactly do we do? (What happens, not what goes in the code.) The trick is called double buffering. We use two framebuffers: the back buffer, which is off-screen, and the front buffer, which is on-screen (visible). We draw into the back buffer. Then, when an animation frame is complete, we swap the buffers, so that the completed frame becomes visible. 2b. [2 pts] What bad thing happens if we do not do this buffer trick? If we do not do this, then the user gets to see partially drawn frames, and the animation appears to flicker. (exam page 2)

3. [12 pts total] Transformations. 3a. [3 pts] In the context of CG, what do we mean by a transformation? A transformation is a mathematical function that maps space to itself. That is, we give it a point in space, and it gives us back a (possibly different) point in space. In computer graphics, transformations are used to position, rotate, scale, and (sometimes) deform objects, to position the camera, and to project the scene onto the viewport. 3b. [9 pts] Finish the list below of kinds of transformations and what they do. One is done; you write three more. Type #1: Translation Effect: Shifts an object s location in space, without affecting size or orientation. Type #2: Rotation Effect: Rotates an object about a line (typically, one passing through the origin), without affecting its size. Type #3: Scale Effect: Expands or contracts an object (typically, about the origin). Generally, we allow scaling the various coordinates (x, y, z) by different factors. Type #4: Perspective projection Effect: Projects the scene onto the viewport in proper perspective (so that more distant objects appear smaller). (exam page 3)

4. [9 pts total] Internal Representations. In the following questions about OpenGL s internal representations, we are talking about the way OpenGL acts like it represents things. 4a. [2 pts] How does OpenGL represent a transformation, internally? OpenGL represents a transformation using a 4 4 matrix. 4b. [2 pts] How does OpenGL represent a point in 3-D space, internally? OpenGL represents a point in 3-D space as a vector with 4 coordinates. 4c. [5 pts] How do we convert to & from the representation in the previous part? Give examples with specific vectors. We convert a 3-D vector to this representation by adding a 4th coordinate whose value is 1. For example, (1, 2, 3) becomes (1, 2, 3, 1). We convert a vector in this representation to a 3-D vector by removing the 4th coordinate and then dividing the other coordinates by it. For example, (1, 2, 3, 4) becomes (1/4, 2/4, 3/4). 5. [4 pts] Display Callback. In a GLUT program, the display function is a callback. What practical effect(s) does this have on the design of a program? Because it is a callback (which is called by GLUT), GLUT gets to decide when drawing occurs. As a result, we should do all drawing in the display function, and no drawing anywhere else, in order that drawing will be done at the proper time. (exam page 4)

6. [7 pts total] Picking. 6a. [2 pts] In the context of this class, what is picking? Picking generally refers to the user choosing an object by clicking the mouse on it. More specifically, when we talk about a picking method, we mean a method for determining which object the user clicked on. 6b. [5 pts] Choose one picking method, and describe how it works. Here are three possibilities. Extent testing. Check the mouse position against the set of pixels used by each object (its extent), in front-to-back order. The first hit is the object selected. Querying the clipper. Reduce the viewport to a single pixel at the mouse position, and query the clipper to see which objects are displayed. The front-most is the object selected. Note: In OpenGL we use selection mode. Reading the framebuffer. Draw the scene with each object in a different color. The color of the pixel at the mouse position indicates which object was selected. 7. [7 pts total] HSR. 7a. [2 pts] What is HSR? HSR stands for Hidden-Surface Removal: ensuring that only visible objects (and portions of objects) appear in an image. 7b. [5 pts] Choose one HSR method, and describe how it works. Here are two possibilities. HSR Using (Reverse) Painter s Algorithm. Draw the primitives making up a scene in back-to-front order (or front-to-back order, never redrawing any pixel). Can use a BSP Tree to determine this order. Z-buffering. Store the depth at each pixel. When a fragment arrives at the framebuffer, check its depth against the stored depth. If less, store its color and depth; otherwise discard the fragment. (exam page 5)

8. [13 pts total] The Rendering Pipeline. 8a. [10 pts] Draw a diagram illustrating the main parts of the graphics rendering pipeline. Indicate at least one operation that occurs in each box, and at least three operations performed on vertices (or groups of vertices). Vertex Operations Rasterization Fragment Operations Model-view transformation Projection transformation Clipping Depth Test The operation occurring in the Rasterization box is rasterization: the generation of fragments from geometry (vertex) data. 8b. [3 pts] We can write two kinds of shaders. Indicate what they are called and where in the pipeline each goes. Vertex shader. Goes inside Vertex Operations box. Replaces the vertex operations before Clipping. Fragment shader. Goes inside Fragment Operations box. Replaces the fragment operations before Depth Test (and the other tests). (exam page 6)

9. [6 pts total] Lambert Cosine. 9a. [2 pts] What is the Lambert cosine? The Lambert cosine is the cosine of the angle between the light-source direction and the surface normal vector. 9b. [2 pts] In practice, how do we compute the Lambert cosine? Hint: We do not actually take the cosine of anything. We compute the Lambert cosine by taking the dot product of the normalized vector indicating the light-source direction with the (normalized) surface normal vector. 9c. [2 pts] How do we use the Lambert cosine? We use the Lambert cosine to compute the intensity of diffuse reflection: Diffuse color = LambertCosine * paintcolor * lightcolor. 10. [6 pts] The Phong Illumination Model. The Phong Illumination Model includes three kinds of lighting/reflection. For each, give its name and a brief description. Type #1: Ambient Description: Light coming from all directions, illuminating every point on a surface equally, regardless of which direction it faces. Type #2: Diffuse Description: Light coming directly from a light source and reflecting equally in all directions. A point facing toward a light source is illuminated in proportion to its Lambert cosine. Type #3: Specular Description: Light coming directly from a light-source and reflecting generally in a mirror-like way. Produces the specular highlight. The brightness of a point is proportional to the cosine of the angle between the reflected light direction and the eye direction, raised to some high-ish power (the shininess). (exam page 7)