350 likes | 358 Views
This outline provides information about the midterm, review topics, drawing in OpenGL, geometry, transforms and coordinate systems, fonts/typography, splines, input devices and interaction, color, and cameras and perspective.
E N D
CS148: Introduction to Computer Graphics and Imaging Midterm Review Session
Outline • Midterm info • Review of topics • Drawing in OpenGL • Geometry: points, lines, vectors • Transforms and coordinate systems • Fonts/typography • Splines • Input devices and interaction • Color • Cameras and perspective
Midterm info • Time: Tue, Feb 13th at 7pm • Location: Building 260, Rm 113 • Duration: 2 hours • Closed book • Consists of a few (4 or 5) multi-part questions • All material through last lecture (cameras) • Strongly emphasized: material on assignments • Focus on: material from lectures • Also covered: material from readings
Drawing in OpenGL • OpenGL primitives • glBegin/glEnd • Double buffering • GLUT events • display • reshape • keyboard
Geometry • Dot product • Cross product • What are orthonormal vectors? • Can you add two points? • What do you get when you add a vector to a point?
Geometry • Line defined by (x1, y1) and (x2, y2) • What is parametric form? • What is implicit form? • Which side of the line is point P on?
Transforms • Think about them in two ways • Applying to object • Applying to coordinate axes • Order matters
Transforms Translate(1,1) Rotate(45O)
Transforms – Apply to object Translate(1,1) Rotate(45O)
Transforms – Apply to object Translate(1,1) Rotate(45O)
Transforms – Apply to coordinate system Translate(1,1) Rotate(45O)
Transforms – Apply to coordinate system Translate(1,1) Rotate(45O)
Transforms – Apply to coordinate system Translate(1,1) Rotate(45O)
Transforms – order matters Translate(1,0) Rotate(45O) Rotate(45O) Translate(1,0)
Transforms – order matters Scale(2,2) Translate(0,1) Translate(0,1) Scale(2,2)
Transforms • Homogeneous coordinates • Transforms as matrices
Transforms • Homogeneous coordinates • Transforms as matrices glScalef(2.0, 3.0) No change glTranslatef(1.0, 1.0) glRotatef(60.0, 0.0, 0.0, 1.0) gluOrtho (0, 200, 0, 200,-1.0, 1.0)
Transforms • Some volume of coordinate space is viewable on screen. • Orthographic projection • glOrtho/gluOrtho2D • Perspective projection • gluPerspective • glFrustum
Transforms • Transforms implemented as matrix vector multiplications (to window coordinates) glViewport Projection transform (camera space to clip space) gluPerspective glRotate Viewing transform (world space to camera space) Vertex position in window= (vx,vy) glTranslate … = M3 M1 M2 M4 M5 M6 M9 glScale glRotate Modeling transform (object space to world space) glTranslate glRotate glScale [vertex V] Ex: (1,0) in object space
Typography • Font units • Terminology • Character map • Glyphs + glyph metrics • Kerning • Leading
Interpolation • Have discrete set of points • Want continuous function going through points
Interpolation • Bilinear interpolation • Barycentric interpolation V3 V = 1V1 + 2V2 + 3V3 1 + 2 + 3 = 1 2 1 V 3 V2 V1
Interpolation • Want curve p(t) to go through all control points Ci
Cubic splines • Basis functions (Bi’s) are cubic polynomials • Different basis functions yield splines with different properties • Hermite Splines • Catmull-Rom Splines • Bezier Splines
Input devices • The user presses a key. What happens?
Input devices • The user presses a key. What happens? Scan code (make and break codes) Virtual key code Glyph index Glyph
Input devices • How does a mouse work? • What is quadrature encoding? • Joystick input • Axes/buttons/D-pads
Interaction • Polling vs. events • Events • Event loop • Event queues • Callbacks (event handlers) • Associating events with objects • Propagating events • Model-view-controller pattern
Physics of light • Energy from source distributed across many wavelengths: S() • Units: Watts
Physics of light • Adding light • L() = E1() + E2() • Filtering light • L() = T()E() • Sensor Response
Color perception • What color do we perceive from E()? • Explain statement: humans have trichromatic color vision • Rods and Cones
Color perception • What is the CIEXYZ color space? • Why is the region within the spectral locus the span of all observable colors? • Luminance • Think: Response of rods to E() • Units = lumens • Lightness = Luminance1/3
Cameras and Lenses • Pinhole camera (x,z) f Field of view film x’ pinhole
Cameras and Lenses • Pinhole camera (x,z) f Field of view film x’ pinhole
Cameras and Lenses • Focal length How does is correspond to zoom? • Depth of field Can a pinhole camera produce depth of field effects? • Bayer mosaic