CS 535 Fall 2007
Midterm Solution Set (100 points)
Closed books and closed notes
1.
Name:_
(15 points)
(a) Is it possible to use a 512 512 frame buffer (bitmap) to control a
1024 1024 display? Justify your answer. (5 points)
Solution:
Yes, use each entry
Viewing Transformations I
Comp 535
Motivation
Want to see our virtual 3-D world on a 2-D
screen
2
Graphics Pipeline
Model Space
Model Transformations
World Space
Viewing Transformation
Eye/Camera
Space
Projection & Window
Transformation
Screen Space
3
Vie
Color
What is Color?
Color is the spectra of light being perceived by
the human visual system
Visible light is electromagnetic energy in the
400 to 700 nm wavelength range
Why discuss color?
Many ways to talk about color: tint, shade, hue,
brightness,
Polygon Scan
Conversion
and Z-Buffering
Rasterization
Rasterization takes shapes like triangles and
determines which pixels to fill.
2
Filling Polygons
First approach:
1. Polygon Scan-Conversion
Rasterize a polygon scan line by scan line,
determining whi
Curves and Surfaces
B-spline Curves
These curves are approximating rather than
interpolating curves.
The curves come close to, but may not actually pass
through, the control points.
Usually used as multiple, joined curve segments
B-splines have C2 con
Texture Mapping
(Some Images from Rosalee Wolff)
Texture Mapping
Problem with shading models:
They assume that a diffuse surface has uniform
reflectance.
This is okay for walls or solid balls, but not most
objects
We could add geometric complexity
Th
CS535 Homework 3
Homework 3 The Solid
Utah Teapot
Due March 23, 2012
In this assignment you will implement the functions to
show a solid and shaded Utah teapot like that shown on
the left.
Your Task:
You should extend your last
CS535 Homework 2
Homework 2 The Utah Teapot
DueFeb22,2012
In this assignment you will implement the
functionality for displaying Bezier surfaces under
different transformations. The goal is to give you
some first-hand experiences of parametric surface
m
CS535 Final Project
Ray Tracing
Due May 2rd, 2012
In this assignment you will implement a basic ray tracer. Use a recursive approach, as
suggested in Foley van Dam et al, paragraph 16.12 and the appropriate lecture notes.
Your program will
CS535 Homework 4
Due: April 5
In this homework, you will use the GLSL to implement per-pixel lighting with a reflection map.
You are required to draw the Utah Teapot with a mirror surface property. The input includes a
cube-map. A typical cube map is show
CS535 Spring 2012 (Homework 1)
Homework 1 2D Drawings
Due Feb 3rd, 2012
In this assignment you will implement an interactive sketchpad. The goal is to give you some
first-hand experience with OpenGL, GLUT, and basic knowledge 2D rasterization operations.
Ray Tracing
Part I
Ray Tracing
What is ray tracing?
Trace the path of a ray of light.
Model its interactions with the scene.
When a ray intersects an object, send off
secondary rays (reflection, shadow, transmission) and
determine how they interact wit
Ray Tracing
Part II
Ray Representation
A ray can be represented explicitly (in parametric form)
as an origin (point) and a direction (vector):
xo
Origin: ro yo
zo
Direction:
r(3)
xd
rd yd
zd
r(2)
ro + rd = r(1)
The ray consists of al
CS 335
Graphics and Multimedia
2D Graphics Primitives and Transformation
2D Coordinate Transforms
Basic Problem : Objects are typically defined in ideal
coordinate system, e.g. ideal coordinate system for a
circle is the origin coincides with the circle c
CS 535
Computer Graphics
2D Drawings: Lines, Circle, and Spline
Primitive Drawing Operations
Digital Concepts of Drawing in Raster Arrays
PIXEL is a single array element at (x,y)
- No smaller drawing unit exists
P(x,y)
y
2
1
0
0 1 2
Drawing Lines
From (x1
Clipping
Comp 535
Line Clipping
What happens when one or both endpoints of
a line segment are not inside the specified
drawing area?
Drawing
Area
2
Line Clipping
Strategies for clipping:
a) Check (in inner loop) if each point is inside
Works, but slow
i
Introduction to
PARAMETRIC SURFACE
Outline
Surface modeling problem
Parametric bicubic surfaces
Bezier surface
Monday, January 23, 2012
Surface Modeling Problem
How to model a complex
surface in 3D space.
Accurately represent the
surface.
Require less
Introduction to Computer
Graphics with OpenGL/GLUT
What is OpenGL?
OpenGL (Open Graphics Library)
A software interface to graphics hardware
a standard specification defining a cross-language,
cross-platform graphics rendering API for writing
applicatio
Window to Viewport
Transformations
Compositing Transformations
Does order matter?
Case 1: translate by (2, 0), scale by (2, 2)
Case 2: scale by (2, 2), translate by (-2, 0)
1 0 2
T 0 1 0
0 0 1
Begin: red, 1st transform: blue, 2nd: green
y
y
(2,6)
(0
3D Transformations
CS 535
3D Space
We want to extend the idea of transformations to
deal with 3D objects
More complex than 2D, but essentially the same
ideas work
Coordinate systems:
y
y
z
x
z
x
Left-handed
Right-handed
We will use a right-handed syst
2D-Drawings
CIRCLE
Representing A Circle
Explicit representation:
y r x
2
2
Implicit representation:
F ( x, y) x y r
2
2
2
F ( x, y) ( x xc ) ( y yc ) r
2
Parametric representation:
x r cos
y r sin
2
2
Drawing Circles
Equation for a circle:
Given: cente
Viewing
Transformations II
Arbitrary Views
Suppose we want to look at the environment from
somewhere besides the z-axis.
How do we do this?
What is the perspective matrix?
Where should an object project onto our new view plane?
Solution:
Set up our
Illumination & Shading
What is a Shading Model?
Model of how light interacts with materials
We will discuss the common, heuristic shading
models:
Flat
Gouraud
Phong
Not physically based: work well in practice and are
common on most graphics boards
2
Global Illumination
Outline
Light transport
Radiometric units
Light received and reflected
Bidirectional reflectance distribution function
2
Light Transport
Different energy transfer
processes:
Conduction
Convection
Radiation
Light transport is e