1 / 23

Graphics Review Geometry, Color & Shading

Graphics Review Geometry, Color & Shading. Brad Tennis Leslie Wu 10.24.06. Topics. Foundations of 2D graphics Coordinate systems Matrices Transformations Algorithms Splines. Topics cont. Color Physical Basis, Representation Reflection Models Shading. Coordinate Systems.

Download Presentation

Graphics Review Geometry, Color & Shading

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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/Image:Srgbspectrum.png

  13. Additive Color • Combination of emitters of different wavelengths • RGB Color (e.g., monitors) http://en.wikipedia.org/wiki/Image:RGB_illumination.jpg

  14. Subtractive Color • Combination of absorbers of different wavelengths • CMYK Color (e.g., printers) http://en.wikipedia.org/wiki/Image:Synthese-.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 • Lambert’s Law: The reflection from a perfectly matte surface is proportional to the dot product of the surface normal and light vector idiff = (n•l)mdiff ⊗ sdiff

  17. Specular Reflection • Not all materials are perfectly matte, and shiny objects tend to reflect primarily along the reflected light vector ispec = (v•r)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 isn’t 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/Image:Butterfly_transparent.jpg cnew = αsrccsrc + (1-αsrc)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

More Related