Color spaces. Draw Buffers Color models. Mathmatical Protocols for defining colors with numbers  RGB Red, Green, Blue  HSV Hue, Saturation, Value(Brightness)‏

Slides:



Advertisements
Similar presentations
OpenGL Open a Win32 Console Application in Microsoft Visual C++.
Advertisements

CGA 115 Professor Mary A. Malinconico. Questions from Last Week ????????
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Programming with OpenGL Part 3: Three Dimensions.
© 2004, Tom Duff and George Ledin Jr1 Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma.
Fundamentals of Digital Imaging
Informationsteknologi Monday, October 29, 2007Computer Graphics - Class 21 Today’s class Graphics programming Color.
Draw a Simple Object. Example 1/4 #include “ glut.h ” void display(); void reshape(GLsizei w, GLsizei h); void main(int argc, char** argv){ glutInit(&argc,
Multi-media Graphics JOUR 205 Color Models & Color Space 5 ways of specifying colors.
Hidden Surfaces and Shading CS BSP Tree T1T1 T2T2 E if (f 1 (E) < 0) then draw T 1 draw T 2 else draw T 2 draw T 1 f 1 (p) = 0 is the.
OpenGL and Projections
1 CSC461 Lecture 7: 3D Programming in OpenGL Objectives: Develop 2D and 3D examples -- Sierpinski gasket: a fractal Develop 2D and 3D examples -- Sierpinski.
Image Representation.
Sierpinski Gasket Program
Lighting & Material. Example 1/5 #include ” glut.h ” void display(); void reshape(int, int); void lighting(); int main(int argc, char** argv) { glutInit(&argc,
1 Internet Graphics. 2 Representing Images  Raster Image: Images consist of “dots” of color, not lines  Pixel: Picture element-tiny rectangle  Resolution:
Reference1. [OpenGL course slides by Rasmus Stenholt]
C O L O R S PRINT VS MULTIMEDIA. Main Difference Print –Primary Colors CMYK Cyan, Magenta, Yellow, Black - Subtractive Color system –Add together = black.
Product Design Sketching Chromatic Theories. Color Spectrum The range of colors seen by human eye is the “visible color spectrum”
Digital Images Chapter 8, Exploring the Digital Domain.
Chapter 2 Getting Started: Drawing Figures. The Framebuffer Lecture 2 Fri, Aug 29, 2003.
Lecture 3 OpenGL.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
Computer Graphics CS 385 January 31, Fractals Some definitions Object which is self-similar at all scales. Regardless of scale the same level of.
Introduction to GL Geb Thomas. Example Code int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
CSC Computing with Images
DREAM PLAN IDEA IMPLEMENTATION Introduction to Computer Graphics Dr. Kourosh Kiani
1 Programming with OpenGL Part 3: Three Dimensions Yuanfeng Zhou Shandong University.
Computer Graphics I, Fall 2010 Programming with OpenGL Part 3: Three Dimensions.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Programming with OpenGL Review.
CS 480/680 Computer Graphics Programming with Open GL Part 6: Three Dimensions Dr. Frederick C Harris, Jr. Fall 2011.
Draw a Simple Object. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture blending.
Intro to OpenGL (Version 2) Geb Thomas. Setting Up GLUT You will need GLUT for opening windows We can use the version made by Nate Robins: –
Do Now: Take out your notebook and a pen. Good Morning Do Now: Take out your notebook and a pen. Good Morning Aim: What is color? Mr. Spaterella Technology.
Color Web Design Professor Frank. Color Displays Based on cathode ray tubes (CRTs) or back- lighted flat-screen Monitors transmit light - displays use.
NoufNaief.net TA: Nouf Al-harbi.
Projections. Viewports Windows can have separate viewports void glViewport(GLint x, GLint y, GLsizei width, GLsizei height ) x, y - Specify the lower.
NoufNaief.net 1 TA: Nouf Al-Harbi.
Intro to Color Theory. Objectives Identify and discuss various color models including RGB, CMYK, Black/white and spot color. Investigate color mixing.
Doç. Dr. Cemil Öz SAÜ Bilgisayar Mühendisliği Dr. Cemil Öz.
OpenGL Basic Drawing 2003 Spring Keng Shih-Ling
HSB to RGB to HEX.
Chap 2 Write a Simple OpenGL Program. Preparing 1/2 environment : Microsoft Visual C 、 Microsoft Visual C++.Net Also need : GLUT
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 3: Three Dimensions Ed Angel Professor of Computer Science,
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 6: Three Dimensions Ed Angel Professor.
CS559: Computer Graphics Lecture 12: OpenGL - Transformation Li Zhang Spring 2008.
31/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 2: Introduction.
CS559: Computer Graphics Lecture 12: OpenGL: ModelView Li Zhang Spring 2010.
OpenGL Basic Drawing Jian-Liang Lin A Smidgen of OpenGL Code #include main() { InitializeAWindowPlease(); glClearColor (0.0, 0.0, 0.0, 0.0); glClear.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 17 Animations, Loops.
Introduction to Graphics Programming. Graphics API.
Graphics Graphics Korea University kucg.korea.ac.kr Graphics Programming 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Computer Graphics -practical- Lecture 6. (visual c++) open gl library To use open GL with VC++ we add these files:- 1)Glut.h C:\program files\ Microsoft.
Colour CPSC Colour ● Models ● RGB ● CMY(K) ● HSB (or HSV) ● RYB ● Harmonies ● Monochrome ● Complementary ● Analogous ● Triadic.
Draw a Simple Object.
Computer Graphics Lecture 33
CITA 342 Section 7 Working with Color.
Programming with OpenGL Part 3: Three Dimensions
OpenGL (Open Graphics Library) Mr. B.A.Swamy Assistant Professor Dept of CSE.
Starting to draw dealing with Windows which libraries? clipping
גרפיקה ממוחשבת: מבוא ל-OpenGL
Programming with OpenGL Part 3: Three Dimensions
Introduction to OpenGL
OpenGL program.
Starting to draw dealing with Windows which libraries? clipping
Programming with OpenGL Part 6: Three Dimensions
Programming with OpenGL Part 3: Three Dimensions
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Programming with OpenGL Part 3: Three Dimensions
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Presentation transcript:

Color spaces. Draw Buffers Color models

Mathmatical Protocols for defining colors with numbers  RGB Red, Green, Blue  HSV Hue, Saturation, Value(Brightness)‏  CYMK Cyan, Yellow, Magenta, Black

RGB Red Green Blue Additive Color Mixing Used for many types of monitors and projectors  Cathode ray, LCD, DLP, and others

CYMK Cyan Yellow Magenta Black Subtractive color mixing Used in printing to describe the inks to use

HSV == HSB Hue  Range of 0° to 360°  Denotes location in light spectrum Saturation  Intensity of a color, 0.0 to 1.0 Value/Brightness  Lightness or darkness of a color, 0.0 to 1.0

Buffers Many types of buffers – Holds data that is stored for each pixel – All buffers for the same window have the same dimensions – Buffers may hold different types/amount of data per pixel Buffer types – Color, depth, alpha, stencil, accumulation

Frame Buffer Comprises all of the buffers used to store data per pixel/fragment ColorDepthAlpha AccumulationStencil Frame Buffer

Depth Buffer Additional component of the frame buffer Holds the depth value of each fragment Needs to be cleared like color buffer Depth Buffer (drawn as greyscale) Color Buffer

Setting up Depth Test OpenGL disables depth test by default  glEnable(GL_DEPTH_TEST); We have an additional part of the frame buffer that needs clearing  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); We need a drawing context that has a depth buffer  glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH);

Depth Test Example void display(void)‏ { glEnable(GL_DEPTH_TEST); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Setup state to start drawing glBegin(GL_TRIANGLES); glVertex3i(-100, 100, 1); glVertex3i(0, 100, 1); glVertex3i(-50, 50, 1); glVertex3i(50, 50, 3); glVertex3i(100, 100, 3); glVertex3i(75, 20, 3); glEnd(); } int main(int argc, char **argv)‏ { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH); glutCreateWindow("Depth Example"); glutDisplayFunc(display); glutReshapeFunc(reshape); glutMainLoop(); return 0; } Display code GLUT initialization

Multiple Frame Buffers More than one frame buffer can be defined – Useful for drawing to a different buffer than the one being displayed Uses – Double Buffering – Drawing for stereoscopic displays ColorDepthAlpha Accumulat ion Stencil Front Frame Buffer ColorDepthAlpha Accumulat ion Stencil Back Frame Buffer

Double Buffering Front frame buffer is displayed  Not drawn to Back frame buffer is actively drawn to  When finished drawing, switch buffers Front BufferBack Buffer

Setting up Double Buffer glFlush() is not needed when double buffering GLUT needs to initialize the display mode to be double buffered  glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); Use GLUT to swap buffers after drawing is completed  glutSwapBuffers();