SlideShare a Scribd company logo
1 of 23
25-03-2021
Before we can display anything, we should address the issues like:
1. In what colors are we drawing?
2. Where on the display does our image appear?
3. How large will the image be?
4. How do we create an area of the display—a window—for our
image?
5. How much of our infinite drawing surface will appear on the
display?
6. How long will the image remain on the display?
Points in 3 dimensions by adding z coordinate
THE OPENGL APPLICATION PROGRAMMING INTERFACE
• A graphics system performs multiple tasks to produce output and handle user
input
• An API for interfacing with this system can contain hundreds of individual
functions
• It will be helpful to divide these functions into seven major groups:
1. Primitive functions
2. Attribute functions
3. Viewing functions
4. Transformation functions
5. Input functions
6. Control functions
7. Query functions
Primitives and Attributes
• The primitive functions define the low-level objects or atomic entities that our system
can display
• Depending on the API, the primitives can include points, line segments, polygons,
pixels, text, and various types of curves and surfaces
• OpenGL supports a very limited set of primitives directly, only points, line segments,
and triangles
• If primitives are the what of an API—the primitive objects that can be displayed—
then attributes are the how
• Attribute functions allow us to perform operations ranging from choosing the color
with which we display a line segment, to picking a pattern with which to fill the inside
of a polygon, to selecting a typeface for the titles on a graph
•Our synthetic camera must be described if we are to create an image
•Must describe the camera’s position and orientation in our world and
must select the equivalent of a lens
•This process will not only fix the view but also allow us to clip out
objects that are too close or too far away
•The viewing functions allow us to specify various views, although APIs
differ in the degree of flexibility they provide in choosing a view
•OpenGL does not provide any viewing functions but relies on the use
of transformations in the shaders to provide the desired view
• A good API provides the user with a set of transformation functions that allows her to
carry out transformations of objects, such as rotation, translation, and scaling
• For interactive applications, an API must provide a set of input functions to allow us to
deal with the diverse forms of input that characterize modern graphics systems. We
need functions to deal with devices such as keyboards, mice, and data tablets
• In any real application, we also have to worry about handling the complexities of
working in a multiprocessing, multiwindow environment—usually an environment
where we are connected to a network and there are other users
• The control functions enable us to communicate with the window system, to initialize
our programs, and to deal with any errors that take place during the execution of our
programs
• To write device-independent programs, the API has to take care of differences between
devices
such as how many colors are supported
or the size of the display
A good API provides this information through a set of query functions
The OpenGL Interface
• OpenGL functions are in a single library named GL (or OpenGL in Windows)
• Function names begin with the letters gl
• Shaders are written in the OpenGL Shading Language (GLSL), which has a separate
specification from OpenGL
• To interface with the window system and to get input from external devices into our
programs, we need at least one more library
• For each major window system there is a system-specific library that provides the “glue”
between the window system and OpenGL
• For the X Window System, this library is called GLX, for Windows, it is wgl, and for the
Macintosh, it is agl
• Rather than using a different library for each system, we use two readily available libraries,
the OpenGL Extension Wrangler (GLEW) and the OpenGL Utility Toolkit (GLUT)
Mapping from vertex coordinates to screen coordinates
PRIMITIVES AND ATTRIBUTES
• Geometric primitives
• Image, or raster, primitives
• Geometric primitives are specified in the problem domain and include points, line segments,
polygons, curves, and surfaces
To display points or line segments
Text
• There are two forms of text: stroke and raster
Stroke text: Constructed as other geometric objects
• We use vertices to specify line segments or curves that outline each character
Raster text is simple and fast
• Characters are defined as rectangles of bits called bit blocks
• Each block defines a single character by the pattern of 0 and 1 bits in the block
• A raster character can be placed in the frame buffer rapidly by a bit-block-
transfer (bitblt) operation, which moves the block of bits using a single function
call
• You can increase the size of raster characters by replicating, or duplicating, pixels
Attributes
Color
Two different approaches
• RGB-color model: Has become the norm
• IndexedColor Model: Easier to support in hardware because of its lower memory
requirements and the limited colors available on displays
VIEWING
• The simplest and OpenGL’s default view is the orthographic projection
Polygons and Recursion
CGV.pptx

More Related Content

Similar to CGV.pptx

Session 9 advance_verification_features
Session 9 advance_verification_featuresSession 9 advance_verification_features
Session 9 advance_verification_features
Nirav Desai
 

Similar to CGV.pptx (20)

2D graphics
2D graphics2D graphics
2D graphics
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Python and GIS: Improving Your Workflow
Python and GIS: Improving Your WorkflowPython and GIS: Improving Your Workflow
Python and GIS: Improving Your Workflow
 
AlgorithmVisualiserProject_TanuJaiswal.pdf
AlgorithmVisualiserProject_TanuJaiswal.pdfAlgorithmVisualiserProject_TanuJaiswal.pdf
AlgorithmVisualiserProject_TanuJaiswal.pdf
 
OpenGL ES EGL Spec&APIs
OpenGL ES EGL Spec&APIsOpenGL ES EGL Spec&APIs
OpenGL ES EGL Spec&APIs
 
Ch-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptxCh-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptx
 
Computer Vision Bootcamp: First Worshop
Computer Vision Bootcamp: First  WorshopComputer Vision Bootcamp: First  Worshop
Computer Vision Bootcamp: First Worshop
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 
Session 9 advance_verification_features
Session 9 advance_verification_featuresSession 9 advance_verification_features
Session 9 advance_verification_features
 
Programming with OpenGL
Programming with OpenGLProgramming with OpenGL
Programming with OpenGL
 
CAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECHCAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECH
 
Final year embedded projects in bangalore
Final year embedded projects in bangaloreFinal year embedded projects in bangalore
Final year embedded projects in bangalore
 
CAD
CADCAD
CAD
 
Unit 3-ME8691 & COMPUTER AIDED DESIGN AND MANUFACTURING
Unit 3-ME8691 & COMPUTER AIDED DESIGN AND    MANUFACTURINGUnit 3-ME8691 & COMPUTER AIDED DESIGN AND    MANUFACTURING
Unit 3-ME8691 & COMPUTER AIDED DESIGN AND MANUFACTURING
 
C- language Lecture 4
C- language Lecture 4C- language Lecture 4
C- language Lecture 4
 
Graphical Objects and Scene Graphs
Graphical Objects and Scene GraphsGraphical Objects and Scene Graphs
Graphical Objects and Scene Graphs
 
Siebel Open UI Presentation
Siebel Open UI PresentationSiebel Open UI Presentation
Siebel Open UI Presentation
 
Open gl basics
Open gl basicsOpen gl basics
Open gl basics
 

Recently uploaded

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 

Recently uploaded (20)

Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 

CGV.pptx

  • 2. Before we can display anything, we should address the issues like: 1. In what colors are we drawing? 2. Where on the display does our image appear? 3. How large will the image be? 4. How do we create an area of the display—a window—for our image? 5. How much of our infinite drawing surface will appear on the display? 6. How long will the image remain on the display?
  • 3.
  • 4.
  • 5. Points in 3 dimensions by adding z coordinate
  • 6. THE OPENGL APPLICATION PROGRAMMING INTERFACE
  • 7. • A graphics system performs multiple tasks to produce output and handle user input • An API for interfacing with this system can contain hundreds of individual functions • It will be helpful to divide these functions into seven major groups: 1. Primitive functions 2. Attribute functions 3. Viewing functions 4. Transformation functions 5. Input functions 6. Control functions 7. Query functions
  • 8. Primitives and Attributes • The primitive functions define the low-level objects or atomic entities that our system can display • Depending on the API, the primitives can include points, line segments, polygons, pixels, text, and various types of curves and surfaces • OpenGL supports a very limited set of primitives directly, only points, line segments, and triangles • If primitives are the what of an API—the primitive objects that can be displayed— then attributes are the how • Attribute functions allow us to perform operations ranging from choosing the color with which we display a line segment, to picking a pattern with which to fill the inside of a polygon, to selecting a typeface for the titles on a graph
  • 9. •Our synthetic camera must be described if we are to create an image •Must describe the camera’s position and orientation in our world and must select the equivalent of a lens •This process will not only fix the view but also allow us to clip out objects that are too close or too far away •The viewing functions allow us to specify various views, although APIs differ in the degree of flexibility they provide in choosing a view •OpenGL does not provide any viewing functions but relies on the use of transformations in the shaders to provide the desired view
  • 10. • A good API provides the user with a set of transformation functions that allows her to carry out transformations of objects, such as rotation, translation, and scaling • For interactive applications, an API must provide a set of input functions to allow us to deal with the diverse forms of input that characterize modern graphics systems. We need functions to deal with devices such as keyboards, mice, and data tablets • In any real application, we also have to worry about handling the complexities of working in a multiprocessing, multiwindow environment—usually an environment where we are connected to a network and there are other users • The control functions enable us to communicate with the window system, to initialize our programs, and to deal with any errors that take place during the execution of our programs • To write device-independent programs, the API has to take care of differences between devices such as how many colors are supported or the size of the display A good API provides this information through a set of query functions
  • 12. • OpenGL functions are in a single library named GL (or OpenGL in Windows) • Function names begin with the letters gl • Shaders are written in the OpenGL Shading Language (GLSL), which has a separate specification from OpenGL • To interface with the window system and to get input from external devices into our programs, we need at least one more library • For each major window system there is a system-specific library that provides the “glue” between the window system and OpenGL • For the X Window System, this library is called GLX, for Windows, it is wgl, and for the Macintosh, it is agl • Rather than using a different library for each system, we use two readily available libraries, the OpenGL Extension Wrangler (GLEW) and the OpenGL Utility Toolkit (GLUT)
  • 13. Mapping from vertex coordinates to screen coordinates
  • 14. PRIMITIVES AND ATTRIBUTES • Geometric primitives • Image, or raster, primitives • Geometric primitives are specified in the problem domain and include points, line segments, polygons, curves, and surfaces
  • 15. To display points or line segments
  • 16.
  • 17. Text • There are two forms of text: stroke and raster Stroke text: Constructed as other geometric objects • We use vertices to specify line segments or curves that outline each character Raster text is simple and fast • Characters are defined as rectangles of bits called bit blocks • Each block defines a single character by the pattern of 0 and 1 bits in the block • A raster character can be placed in the frame buffer rapidly by a bit-block- transfer (bitblt) operation, which moves the block of bits using a single function call • You can increase the size of raster characters by replicating, or duplicating, pixels
  • 19. Color
  • 20. Two different approaches • RGB-color model: Has become the norm • IndexedColor Model: Easier to support in hardware because of its lower memory requirements and the limited colors available on displays
  • 21. VIEWING • The simplest and OpenGL’s default view is the orthographic projection