CMPE 466 COMPUTER GRAPHICS Chapter 5 Attributes of Graphics Primitives Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth.

Slides:



Advertisements
Similar presentations
Presented by: Stacy C. Lovell. How do we perceive color? Our eyes contain only 3 types of photosentitive cells tuned to three frequencies Red, Green,
Advertisements

Line and Curve Drawing Algorithms. Line Drawing x0x0 y0y0 x end y end.
Chapter 2: Graphics Programming
CHAPTER 3 2D GRAPHICS ALGORITHMS
CMPE 466 COMPUTER GRAPHICS
#include int line_width = 1; void Display( void ) { glEnable( GL_LINE_STIPPLE ); glClearColor (0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT);
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
2IV60 Computer graphics Graphics primitives and attributes Jack van Wijk TU/e.
© 2001 By Default! A Free sample background from Slide 1 Attributes of Output Primitives Definition Parameter that affects.
CMPE 466 COMPUTER GRAPHICS
Informationsteknologi Monday, October 29, 2007Computer Graphics - Class 21 Today’s class Graphics programming Color.
CMPE 466 COMPUTER GRAPHICS
CMPE 466 COMPUTER GRAPHICS
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Computer Science,
1 Lecture 6 Attributes of graphical primitives Colors Colors in OpenGL Algorithms for scan-conversion.
CMPE 466 COMPUTER GRAPHICS
CSC 461: Lecture 6 1 CSC461 Lecture 6: 2D Programming in OpenGL Objectives:  Fundamental OpenGL primitives  Attributes  Viewport.
COMPUTER GRAPHICS Prepared by S.MAHALAKSHMI Asst. Prof(Sr) / SCSE VIT University.
JOGL in MS Windows GDI – Graphics Device Interface (Windows-specific) OpenGL Lib JOGL Commands GDI Processor Graphics Hardware JOGL Lib.
CGMB214: Introduction to Computer Graphics
Using OpenGL. 2 What is OpenGL? A software interface to graphics hardware It is a Graphics Rendering API (Application Programmer’s Interface) that is.
ATTRIBUTES OF GRAPHICS PRIMITIVES CA 302 Computer Graphics and Visual Programming Aydın Öztürk
Drawing Basic Graphics Primitives Lecture 4 Wed, Sep 3, 2003.
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
1 Introduction Line attribute Color and gray scale Area filled attribute Anti-aliasing.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
1. OpenGL/GLU/GLUT  OpenGL v4.0 (latest) is the “core” library that is platform independent  GLUT v3.7 is an auxiliary library that handles window creation,
CGMB214: Introduction to Computer Graphics
INT 840E Computer graphics Introduction & Graphic’s Architecture.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Introduction to OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
Computer Graphics Bing-Yu Chen National Taiwan University.
Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera Real Light Synthetic Light Source.
Intro to OpenGL: Vertices and Drawing
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Color and Color Models Angel 2.5 Angel: Interactive Computer Graphics5E © Addison-Wesley
1 Graphics CSCI 343, Fall 2015 Lecture 5 Color in WebGL.
NoufNaief.net 1 TA: Nouf Al-Harbi.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
CS552: Computer Graphics Lecture 6: Viewing in 2D.
1 Programming with OpenGL Part 2: Complete Programs.
OpenGL API 2D Graphic Primitives Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Chapter 4 -- Color1 Color Open GL Chapter 4. Chapter 4 -- Color2 n The goal of almost all OpenGL applications is to draw color pictures in a window on.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 4: Color and Attributes Isaac Gang University.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
Computer Graphics Lecture 17 Fasih ur Rehman. Last Class 3D Transforms Inverse Rotation.
Attributes of Graphics Primitives Chapter 4
Computer Graphics I, Fall Programming with OpenGL Part 2: Complete Programs.
ATTRIBUTE OF OUTPUT PRIMITIVES. Attribute of Output Primitives 30/9/2008 A.Aruna/Assistant professor/IT/SNSCE 2 Definition Line Attribute Curve Attribute.
10/10/2006TCSS458A Isabelle Bichindaritz1 Line and Circle Drawing Algorithms.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Rasterization CENG 477 Introduction to Computer Graphics Slides from Steve Marschner, CS4620, 2008 Cornell University.
CSC Graphics Programming
Draw a Simple Object.
Programming with OpenGL Part 2: Complete Programs
Lecture 18 Fasih ur Rehman
Programming with OpenGL Part 2: Complete Programs
Lab 3 Geometric Drawing Lab 3 Geometric Drawing.
Introduction to Computer Graphics with WebGL
Programming with OpenGL Part 4: Color and Attributes
o عَلَّمَهُ الْبَيَانَ
Color and Shading Lecture 9 Mon, Sep 26, 2005.
Programming with OpenGL Part 2: Complete Programs
Programming with OpenGL Part 2: Complete Programs
Programming with OpenGL Part 4: Color and Attributes
CS297 Graphics with Java and OpenGL
Programming with OpenGL Part 2: Complete Programs
Presentation transcript:

CMPE 466 COMPUTER GRAPHICS Chapter 5 Attributes of Graphics Primitives Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn, M. Pauline Baker, and Warren R. Carithers - Fundamentals of Computer Graphics, Third Edition by by Peter Shirley and Steve Marschner 1

State system or state machine and attributes A graphics system maintains a list for the current values of attributes and other parameters Attributes are referred to as state variables or parameters Examples of attributes Color Size All OpenGL state parameters have default values Parameters remain in effect until new values are specified 2

RGB color 3 Grayscale: When RGB color settings specify an equal amount of R, G, and B, the result is the some shade of gray

Color lookup table or color map 4 Figure 5-1 A color lookup table with 24 bits per entry that is accessed from a frame buffer with 8 bits per pixel. A value of 196 stored at pixel position (x, y) references the location in this table containing the hexadecimal value 0x0821 (a decimal value of 2081). Each 8-bit segment of this entry controls the intensity level of one of the three electron guns in an RGB monitor. Extended color capability with less memory requirement

Other color parameters Intensity Quantifies the amount of light energy radiating in a particular direction over a period of time (physical) Luminance Characterizes the perceived brightness of light (psychological) 5

OpenGL color functions Specifying a single frame buffer and RGB mode Selecting the current color Selecting display window color 6

OpenGL point-size function 7

OpenGL line-style function glLineStipple (repeatFactor, pattern); “pattern” references a 16-bit integer A 1 denotes an on pixel position, a 0 denotes an off pixel position Default value is 0xFFFF “repeatFactor” specifies how many times each bit in the pattern is to be repeated before the next bit in the pattern is applied Default value is 1 8

OpenGL line-width and line-style functions /* Define a two-dimensional world-coordinate data type. */ typedef struct { float x, y; } wcPt2D; wcPt2D dataPts [5]; void linePlot (wcPt2D dataPts [5]) { int k; glBegin (GL_LINE_STRIP); for (k = 0; k < 5; k++) glVertex2f (dataPts [k].x, dataPts [k].y); glFlush ( ); glEnd ( ); } /* Invoke a procedure here to draw coordinate axes. */ glEnable (GL_LINE_STIPPLE); /* Input first set of (x, y) data values. */ glLineStipple (1, 0x1C47); // Plot a dash-dot, standard-width polyline. linePlot (dataPts); /* Input second set of (x, y) data values. */ glLineStipple (1, 0x00FF); // Plot a dashed, double- width polyline. glLineWidth (2.0); linePlot (dataPts); /* Input third set of (x, y) data values. */ glLineStipple (1, 0x0101); // Plot a dotted, triple- width polyline. glLineWidth (3.0); linePlot (dataPts); glDisable (GL_LINE_STIPPLE); 9

Line-attribute functions 10 Figure 5-3 Plotting three data sets with three different OpenGL line styles and line widths: single-width dash-dot pattern, double-width dash pattern, and triple-width dot pattern.

OpenGL fill-area functions 11 … Specification of vertices of polygon …

Texture and interpolation patterns 12 // Shading mode (default)