Graphics Review Geometry, Color - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Graphics Review Geometry, Color

Description:

... Law: The reflection from a perfectly matte surface is proportional to the dot ... Not all materials are perfectly matte, and shiny objects tend to reflect ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 24
Provided by: phdcomp5
Category:

less

Transcript and Presenter's Notes

Title: Graphics Review Geometry, Color


1
Graphics ReviewGeometry,Color Shading
  • Brad Tennis
  • Leslie Wu
  • 10.24.06

2
Topics
  • Foundations of 2D graphics
  • Coordinate systems
  • Matrices
  • Transformations
  • Algorithms
  • Splines

3
Topics cont.
  • Color
  • Physical Basis, Representation
  • Reflection Models
  • Shading

4
Coordinate Systems
  • Cartesian coordinates
  • (x, y)
  • note (xh, yh, h) with h 0
  • corresponds to point at infinity
  • Homogeneous coordinate
  • (xh, yh, h)
  • where
  • x xh / h
  • y yh / h

5
Basic definitions
  • Affine transformation
  • Parallel lines map to parallel lines
  • Finite points map to finite points
  • Examples in 2D
  • Translation, rotation, scaling, reflection, shear

6
Transformation Matrices
  • Translation
  • Rotation
  • Scaling

7
Matrix Properties
  • Translation is additive
  • Rotation is additive
  • ...both are commutative
  • Rotation matrices are orthogonal

8
Algorithms
  • Clipping
  • Interior saves inside region
  • Exterior saves parts outside of region
  • Intersection
  • Point in triangle
  • Can be computed using cross-products (see handout)

9
Splines
  • Spline curve
  • Composite curve made out of polynomial sections
  • Satisfies continuity conditions at section
    boundaries

Control graph / characteristic polygon
Control points
10
Continuity
  • Parametric continuity
  • Zero-order (C0) curves meet
  • First-order (C1) first parametric derivatives
    same
  • Second-order (C2) 1st and 2nd derivatives same
  • Geometric continuity
  • Zero-order (G0) same as C0
  • First-order (G1) 1st derivatives proportional
  • Second-order (G2) 1st and 2nd derivatives
    proportional

11
Bezier Splines
  • Properties
  • Curve is polynomial of degree ( control points
    1)
  • Can be defined recursively
  • For example, to plot midpoint of Bezier of
    degree two

12
Physical Basis
  • Humans can distinguish roughly 10 million colors
  • The eye has three different types of cones
  • The response of each peaks at either 420, 534 or
    564 nm

http//en.wikipedia.org/wiki/ImageSrgbspectrum.pn
g
13
Additive Color
  • Combination of emitters of different wavelengths
  • RGB Color (e.g., monitors)

http//en.wikipedia.org/wiki/ImageRGB_illuminatio
n.jpg
14
Subtractive Color
  • Combination of absorbers of different wavelengths
  • CMYK Color (e.g., printers)

http//en.wikipedia.org/wiki/ImageSynthese-.svg
15
Color Representation
  • Each light is modeled as the summation of three
    monochromatic lights (RGB)
  • Each object has a collection of material
    properties which determine how it reflects light

16
Diffuse Reflection
  • Lamberts Law The reflection from a perfectly
    matte surface is proportional to the dot product
    of the surface normal and light vector

idiff (nl)mdiff ? sdiff
17
Specular Reflection
  • Not all materials are perfectly matte, and shiny
    objects tend to reflect primarily along the
    reflected light vector

ispec (vr)mshi mspec ? sspec
18
Ambient Reflection
  • Sometimes light reaches an object indirectly
    (e.g., from bouncing off walls in the scene)

iamb mamb ? samb
19
Emission
  • Sometimes a surface might represent a light
  • Note that emissive surfaces do not light other
    objects

iem mem
20
Putting it Together
  • The materials model used by most graphics systems
    isnt necessarily physically accurate
  • However, it provides a enough control to the
    programmer for most any effect

itot idiff ispec iamb iem
21
Transparency
  • Typically implemented with a color buffer
  • Unless objects are rendered back to front, pixels
    can get incorrect colors

http//en.wikipedia.org/wiki/ImageButterfly_trans
parent.jpg
cnew asrccsrc (1-asrc)cdest
22
Shading Techniques
Flat Gouraud Phong
http//www.cs.cmu.edu/ph/nyit/facet_gouraud_phong
.jpeg
23
Shading Comparison
  • Flat shading is very fast, but looks blocky
  • Phong shading looks great, but is difficult to
    compute
  • Gouraud shading offers a balance of speed and
    quality
Write a Comment
User Comments (0)
About PowerShow.com