Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS148: Introduction to Computer Graphics and Imaging Midterm Review Session.

Similar presentations


Presentation on theme: "CS148: Introduction to Computer Graphics and Imaging Midterm Review Session."— Presentation transcript:

1 CS148: Introduction to Computer Graphics and Imaging Midterm Review Session

2 CS148 Midterm ReviewPat Hanrahan, Winter 2007 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

3 CS148 Midterm ReviewPat Hanrahan, Winter 2007 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

4 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Drawing in OpenGL OpenGL primitives glBegin/glEnd Double buffering GLUT events display reshape keyboard

5 CS148 Midterm ReviewPat Hanrahan, Winter 2007 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?

6 CS148 Midterm ReviewPat Hanrahan, Winter 2007 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?

7 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms Think about them in two ways Applying to object Applying to coordinate axes Order matters

8 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms Translate(1,1) Rotate(45 O )

9 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms – Apply to object Translate(1,1) Rotate(45 O )

10 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms – Apply to object Translate(1,1) Rotate(45 O )

11 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms – Apply to coordinate system Translate(1,1) Rotate(45 O )

12 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms – Apply to coordinate system Translate(1,1) Rotate(45 O )

13 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms – Apply to coordinate system Translate(1,1) Rotate(45 O )

14 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms – order matters Translate(1,0) Rotate(45 O ) Translate(1,0)

15 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms – order matters Scale(2,2) Translate(0,1) Scale(2,2)

16 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms Homogeneous coordinates Transforms as matrices

17 CS148 Midterm ReviewPat Hanrahan, Winter 2007 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)

18 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms Some volume of coordinate space is viewable on screen. Orthographic projection glOrtho/gluOrtho2D Perspective projection gluPerspective glFrustum

19 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Transforms Transforms implemented as matrix vector multiplications glTranslate glRotate glScale glRotate glScale glRotate glTranslate gluPerspective glViewport Modeling transform (object space to world space) Viewing transform (world space to camera space) Projection transform (camera space to clip space) (to window coordinates) [vertex V] Ex: (1,0) in object space M1M2 M3 M4 M5M6M9 … = Vertex position in window= (vx,vy)

20 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Typography Font units Terminology Character map Glyphs + glyph metrics Kerning Leading

21 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Interpolation Have discrete set of points Want continuous function going through points

22 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Interpolation Bilinear interpolation Barycentric interpolation V3V3 V2V2 V1V1 33 22 11 V V =  1 V 1 +  2 V 2 +  3 V 3  1 +  2 +  3 = 1

23 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Interpolation Want curve p(t) to go through all control points C i

24 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Cubic splines Basis functions (B i ’s) are cubic polynomials Different basis functions yield splines with different properties Hermite Splines Catmull-Rom Splines Bezier Splines

25 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Input devices The user presses a key. What happens?

26 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Input devices The user presses a key. What happens? Scan code (make and break codes) Virtual key code Glyph index Glyph

27 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Input devices How does a mouse work? What is quadrature encoding? Joystick input Axes/buttons/D-pads

28 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Interaction Polling vs. events Events Event loop Event queues Callbacks (event handlers) Associating events with objects Propagating events Model-view-controller pattern

29 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Physics of light Energy from source distributed across many wavelengths: S( ) Units: Watts

30 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Physics of light Adding light L( ) = E 1 ( ) + E 2 ( ) Filtering light L( ) = T( )E( ) Sensor Response

31 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Color perception What color do we perceive from E( )? Explain statement: humans have trichromatic color vision Rods and Cones

32 CS148 Midterm ReviewPat Hanrahan, Winter 2007 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 = Luminance 1/3

33 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Cameras and Lenses Pinhole camera film f x’ (x,z) pinhole Field of view

34 CS148 Midterm ReviewPat Hanrahan, Winter 2007 Cameras and Lenses Pinhole camera film f x’ (x,z) pinhole Field of view

35 CS148 Midterm ReviewPat Hanrahan, Winter 2007 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


Download ppt "CS148: Introduction to Computer Graphics and Imaging Midterm Review Session."

Similar presentations


Ads by Google