Download presentation
Presentation is loading. Please wait.
Published byMoses Abel Bell Modified over 9 years ago
1
Color and Color Models Angel 2.5 Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 1
2
COLOR Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 2
3
Color Distribution Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 3
4
Color Formation Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 4
5
5 Color Values
6
HSV Cone Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 6 http://en.wikipedia.org/wiki/Image:HSV_cone.jpg
7
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 7 http://en.wikipedia.org/wiki/Image:CIExy1931.svg CIE 1931 color space chromaticity diagram
8
Color Gamut Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 8
9
Attributes Attributes are part of the OpenGL state and determine the appearance of objects –Color (points, lines, polygons) –Size and width (points, lines) –Stipple pattern (lines, polygons) –Polygon mode Display as filled: solid color or stipple pattern Display edges Display vertices Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 9
10
OpenGL Attribute API glLineWidth(w); glPointSize(w); glClearColor(r,g,b,a); glColor3f(r,g,b); Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 10
11
RGB color Each color component is stored separately in the frame buffer Usually 8 bits per component in buffer Note in glColor3f the color values range from 0.0 (none) to 1.0 (all), whereas in glColor3ub the values range from 0 to 255 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 11
12
Indexed Color Colors are indices into tables of RGB values Requires less memory –indices usually 8 bits –not as important now Memory inexpensive Need more colors for shading Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 12
13
Color and State The color as set by glColor becomes part of the state and will be used until changed –Colors and other attributes are not part of the object but are assigned when the object is rendered We can create conceptual vertex colors by code such as glColor glVertex glColor glVertex Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 13
14
Smooth Color Default is smooth shading –OpenGL interpolates vertex colors across visible polygons Alternative is flat shading –Color of first vertex determines fill color glShadeModel (GL_SMOOTH) or GL_FLAT Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 14
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.