SlideShare uma empresa Scribd logo
1 de 27
•OpenGL, stand for "Open Graphics Library,”
•OpenGL is a software interface that allows the programmer to create 2D and 3D
graphics images.
•It is Language independent
•It is Platform independent
•OpenGL is a software interface to graphics hardware.
•This interface consists of about 150 distinct commands that you use to specify the
objects and operations needed to produce interactive three-dimensional
applications.
●OpenGL is designed as a streamlined, hardware-independent interface to be
implemented on many different hardware platforms.
●To achieve these qualities, no commands for performing windowing tasks or
obtaining user input are included in OpenGL; instead, you must work through
whatever windowing system controls the particular hardware you’re using.
OpenGL architecture : The OpenGL architecture is structured as pipeline..
Commands enter in the pipeline from the left.
1) Display list :
● Commands may either be accumulated in display lists, or processed
immediately through the pipeline.
● Display lists allow for greater optimization and command reuse, but not
all commands can be put in display lists.
1) Evaluator : The first stage in the pipeline is the evaluator. This stage
effectively takes any polynomial evaluator commands and evaluates them
into their corresponding vertex and attribute commands.
2) per-vertex operations : The second stage is the per-vertex operations,
including transformations, lighting, clipping , and viewport mapping.
4) Rasterization :
● It is converting a vector image (a mathematically defined image of points
and curves) to a raster image (a picture composed of discrete pixels).
● Rasterization is commonly used in real-time 3D graphics processing to
convert images quickly for display on a computer monitor.
5) Per-fragment operations :
The fourth stage is the per-fragment operations. Before fragments go to the
framebuffer, they may be subjected to a series of conditional tests and
modifications, such as blending or z-buffering.
6) Frame buffer :
A frame buffer is a large, contiguous piece of computer memory. Picture
related information stored in a frame buffer. At a minimum there is one
memory bit for each pixel.
Parts of the framebuffer may be fed back into the pipeline as pixel rectangles.
7) Texture memory is a type of digital storage that makes texture data readily
available.Texture memory may be used in the rasterization process
Clipping
The primary use of clipping in computer graphics is to remove objects, lines, or
line segments that are outside the viewing pane.
Window to Viewport Transformation
It is the process of transforming a 2D world-coordinate objects to device coordinates.
Color Blending : Color blending is a way to mix two colors together to
produce to third color.
Z-buffer : Z-buffer, which is also known as the Depth-buffer method is
one of the commonly used method for hidden surface detection.
Construct shapes from geometric primitives, thereby creating
mathematical descriptions of objects.
(OpenGL considers points, lines, polygons, images, and bitmaps to be
primitives.)
Arrange the objects in three-dimensional space and select the desired
vantage point for viewing the composed scene.
Calculate the color of all the objects. The color might be explicitly
assigned by the application, determined from specified lighting
conditions, obtained by pasting a texture on to the objects, or some
combination of these three actions.
Convert the mathematical description of objects and their associated
color information to pixels on the screen. This process is called
rasterization.
Operations Carried out by OpenGL:
Geometric Primitives
Points
Coordinate
s
Size
Lines
Vertices
Width
Stippling
Polygons
Vertices
Outline/solid
Normals
OpenGL Primitives :
● In OpenGL, an object is made up of geometric primitives such as triangle,
quad, line segment and point.
● A primitive is made up of one or more vertices. OpenGL supports the
following primitives
1) GL_POINTS
● Treats each vertex as a single point.
● Vertex n defines a point n.
● N points are drawn.
2) GL_LINES
● Treats each pair of vertices as an independent line segment.
3) GL_LINE_STRIP
● Draws a connected group of line segments from the first vertex to the
last.
4) GL_LINE_LOOP
● Draws a connected group of line segments from the first vertex to the
last, then back to the first.
5) GL_TRIANGLES
● Treats each triplet of vertices as an independent triangle.
6) GL_TRIANGLE_STRIP
● Draws a connected group of triangles.
7) GL_TRIANGLE_FAN
● Draws a connected group of triangles that fan around a central point.
8) GL_QUADS
● Treats each group of four vertices as an independent quadrilateral.
9) GL_QUAD_STRIP
● Draws a connected group of quadrilaterals.
9) GL_Polygon
● Draw a polygon
Sample code
glBegin(GL_POLYGON);
glVertex3fv(p1);
glVertex3fv(p2);
glVertex3fv(p3);
glVertex3fv(p4);
glEnd();
Attributes
•An attribute is any property that determines how a geometric
primitives is to be rendered
•Each time, OpenGL processes a vertex, it uses data stored in its internal
attribute tables to determine how the vertex should be transformed,
rendered or any of OpenGL’s other modes
glPointSize(3.0);
glShadeModel(GL_SMOOTH);
glBegin(GL_LINE);
glColor4f(1.0, 1.0, 1.0, 1.0);
glVertex2f(5.0, 5.0);
glColor3f(0.0, 1.0, 0.0);
glVertex2f(25.0, 5.0);
glEnd();
OpenGL Functions
Primitive functions : Defines low level objects such as points, line segments, polygons etc.
Attribute functions : Attributes determine the appearance of objects
 Color (points, lines, polygons)
 Size and width (points, lines)
 Polygon mode :
• Display as filled
• Display edges
• Display vertices
Viewing functions: Allows us to specify various views by describing the camera’s position and
orientation.
Transformation functions :Provides user to carry out transformation of objects like rotation,
scaling etc.
Input functions: Allows us to deal with a diverse to finput devices like keyboard, mouse etc
Control functions: Enables us to initialize our programs, helps in dealing with any errors
during execution of the program.
Query functions: Helps querying formation about the properties of the particular
implementation.
OpenGL Functions
Control Functions (interaction with windows)
Window–A rectangular area of our display.
Modern systems allow many windows to be displayed on the screen (multi
window environment).
The position of the window is with reference to the origin. The origin(0,0) is the
top left corner of the screen.
glutInit allows application to get command line arguments and initializes system
gluInitDisplayMode requests properties for the window (the rendering context)
• RGBcolor
• Singlebuffering
• Properties logically OR edtogether
glutWindowSize in pixels
glutWindowPosition from top-left corner of display
glutCreateWindow create window with a particular title
Libraries to Include
● GL, for which the commands begin with GL;
● GLUT, the GL Utility Toolkit, opens windows, develops menus,
and manages events.
● GLU, the GL Utility Library, which provides high level routines
to handle complex mathematical and drawing operations.
● GLUI, the User Interface Library, which is completely integrated
with the GLUT library.
○ The GLUT functions must be available for GLUI to operate
properly.
○ GLUI provides sophisticated controls and menus to
OpenGL applications.

Mais conteúdo relacionado

Semelhante a 3 CG_U1_P2_PPT_3 OpenGL.pptx

OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
Girish Ghate
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
Jungsoo Nam
 
OpenGL ES on Android
OpenGL ES on AndroidOpenGL ES on Android
OpenGL ES on Android
Chris Farrell
 

Semelhante a 3 CG_U1_P2_PPT_3 OpenGL.pptx (20)

Programming with OpenGL
Programming with OpenGLProgramming with OpenGL
Programming with OpenGL
 
CGV.pptx
CGV.pptxCGV.pptx
CGV.pptx
 
Computer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGLComputer Graphics Project on Sinking Ship using OpenGL
Computer Graphics Project on Sinking Ship using OpenGL
 
2D graphics
2D graphics2D graphics
2D graphics
 
Dynamic sorting algorithm vizualizer.pdf
Dynamic sorting algorithm vizualizer.pdfDynamic sorting algorithm vizualizer.pdf
Dynamic sorting algorithm vizualizer.pdf
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
 
Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
 
OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL Introduction
 
Open gl basics
Open gl basicsOpen gl basics
Open gl basics
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI Platforms
 
OpenGL ES EGL Spec&APIs
OpenGL ES EGL Spec&APIsOpenGL ES EGL Spec&APIs
OpenGL ES EGL Spec&APIs
 
CAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECHCAD STANDARDS - SMART MANUFACTURING MECH
CAD STANDARDS - SMART MANUFACTURING MECH
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
 
Data structures graphics library in computer graphics.
Data structures  graphics library in computer graphics.Data structures  graphics library in computer graphics.
Data structures graphics library in computer graphics.
 
Graphics Libraries
Graphics LibrariesGraphics Libraries
Graphics Libraries
 
OpenGL ES on Android
OpenGL ES on AndroidOpenGL ES on Android
OpenGL ES on Android
 
Computer graphics - Nitish Nagar
Computer graphics - Nitish NagarComputer graphics - Nitish Nagar
Computer graphics - Nitish Nagar
 
Open gl
Open glOpen gl
Open gl
 

Mais de ssuser255bf1 (9)

Characteristics of Display Adapter
Characteristics of Display AdapterCharacteristics of Display Adapter
Characteristics of Display Adapter
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
1.2.3.pptx
1.2.3.pptx1.2.3.pptx
1.2.3.pptx
 
1.1.2.pdf
1.1.2.pdf1.1.2.pdf
1.1.2.pdf
 
1.1.1.pptx
1.1.1.pptx1.1.1.pptx
1.1.1.pptx
 
CG_U4_M1.pptx
CG_U4_M1.pptxCG_U4_M1.pptx
CG_U4_M1.pptx
 
CG_U2_M2.pptx
CG_U2_M2.pptxCG_U2_M2.pptx
CG_U2_M2.pptx
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx
 
CG_U1_M1_PPT_1.pptx
CG_U1_M1_PPT_1.pptxCG_U1_M1_PPT_1.pptx
CG_U1_M1_PPT_1.pptx
 

Último

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 

Último (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
(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
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
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
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 

3 CG_U1_P2_PPT_3 OpenGL.pptx

  • 1.
  • 2. •OpenGL, stand for "Open Graphics Library,” •OpenGL is a software interface that allows the programmer to create 2D and 3D graphics images. •It is Language independent •It is Platform independent •OpenGL is a software interface to graphics hardware. •This interface consists of about 150 distinct commands that you use to specify the objects and operations needed to produce interactive three-dimensional applications. ●OpenGL is designed as a streamlined, hardware-independent interface to be implemented on many different hardware platforms. ●To achieve these qualities, no commands for performing windowing tasks or obtaining user input are included in OpenGL; instead, you must work through whatever windowing system controls the particular hardware you’re using.
  • 3. OpenGL architecture : The OpenGL architecture is structured as pipeline.. Commands enter in the pipeline from the left.
  • 4. 1) Display list : ● Commands may either be accumulated in display lists, or processed immediately through the pipeline. ● Display lists allow for greater optimization and command reuse, but not all commands can be put in display lists. 1) Evaluator : The first stage in the pipeline is the evaluator. This stage effectively takes any polynomial evaluator commands and evaluates them into their corresponding vertex and attribute commands. 2) per-vertex operations : The second stage is the per-vertex operations, including transformations, lighting, clipping , and viewport mapping.
  • 5. 4) Rasterization : ● It is converting a vector image (a mathematically defined image of points and curves) to a raster image (a picture composed of discrete pixels). ● Rasterization is commonly used in real-time 3D graphics processing to convert images quickly for display on a computer monitor.
  • 6. 5) Per-fragment operations : The fourth stage is the per-fragment operations. Before fragments go to the framebuffer, they may be subjected to a series of conditional tests and modifications, such as blending or z-buffering. 6) Frame buffer : A frame buffer is a large, contiguous piece of computer memory. Picture related information stored in a frame buffer. At a minimum there is one memory bit for each pixel. Parts of the framebuffer may be fed back into the pipeline as pixel rectangles. 7) Texture memory is a type of digital storage that makes texture data readily available.Texture memory may be used in the rasterization process
  • 7. Clipping The primary use of clipping in computer graphics is to remove objects, lines, or line segments that are outside the viewing pane.
  • 8. Window to Viewport Transformation It is the process of transforming a 2D world-coordinate objects to device coordinates.
  • 9. Color Blending : Color blending is a way to mix two colors together to produce to third color.
  • 10. Z-buffer : Z-buffer, which is also known as the Depth-buffer method is one of the commonly used method for hidden surface detection.
  • 11. Construct shapes from geometric primitives, thereby creating mathematical descriptions of objects. (OpenGL considers points, lines, polygons, images, and bitmaps to be primitives.) Arrange the objects in three-dimensional space and select the desired vantage point for viewing the composed scene. Calculate the color of all the objects. The color might be explicitly assigned by the application, determined from specified lighting conditions, obtained by pasting a texture on to the objects, or some combination of these three actions. Convert the mathematical description of objects and their associated color information to pixels on the screen. This process is called rasterization. Operations Carried out by OpenGL:
  • 13. OpenGL Primitives : ● In OpenGL, an object is made up of geometric primitives such as triangle, quad, line segment and point. ● A primitive is made up of one or more vertices. OpenGL supports the following primitives 1) GL_POINTS ● Treats each vertex as a single point. ● Vertex n defines a point n. ● N points are drawn.
  • 14. 2) GL_LINES ● Treats each pair of vertices as an independent line segment.
  • 15. 3) GL_LINE_STRIP ● Draws a connected group of line segments from the first vertex to the last.
  • 16. 4) GL_LINE_LOOP ● Draws a connected group of line segments from the first vertex to the last, then back to the first.
  • 17. 5) GL_TRIANGLES ● Treats each triplet of vertices as an independent triangle.
  • 18. 6) GL_TRIANGLE_STRIP ● Draws a connected group of triangles.
  • 19. 7) GL_TRIANGLE_FAN ● Draws a connected group of triangles that fan around a central point.
  • 20. 8) GL_QUADS ● Treats each group of four vertices as an independent quadrilateral.
  • 21. 9) GL_QUAD_STRIP ● Draws a connected group of quadrilaterals.
  • 24. Attributes •An attribute is any property that determines how a geometric primitives is to be rendered •Each time, OpenGL processes a vertex, it uses data stored in its internal attribute tables to determine how the vertex should be transformed, rendered or any of OpenGL’s other modes glPointSize(3.0); glShadeModel(GL_SMOOTH); glBegin(GL_LINE); glColor4f(1.0, 1.0, 1.0, 1.0); glVertex2f(5.0, 5.0); glColor3f(0.0, 1.0, 0.0); glVertex2f(25.0, 5.0); glEnd();
  • 25. OpenGL Functions Primitive functions : Defines low level objects such as points, line segments, polygons etc. Attribute functions : Attributes determine the appearance of objects  Color (points, lines, polygons)  Size and width (points, lines)  Polygon mode : • Display as filled • Display edges • Display vertices Viewing functions: Allows us to specify various views by describing the camera’s position and orientation. Transformation functions :Provides user to carry out transformation of objects like rotation, scaling etc. Input functions: Allows us to deal with a diverse to finput devices like keyboard, mouse etc Control functions: Enables us to initialize our programs, helps in dealing with any errors during execution of the program. Query functions: Helps querying formation about the properties of the particular implementation.
  • 26. OpenGL Functions Control Functions (interaction with windows) Window–A rectangular area of our display. Modern systems allow many windows to be displayed on the screen (multi window environment). The position of the window is with reference to the origin. The origin(0,0) is the top left corner of the screen. glutInit allows application to get command line arguments and initializes system gluInitDisplayMode requests properties for the window (the rendering context) • RGBcolor • Singlebuffering • Properties logically OR edtogether glutWindowSize in pixels glutWindowPosition from top-left corner of display glutCreateWindow create window with a particular title
  • 27. Libraries to Include ● GL, for which the commands begin with GL; ● GLUT, the GL Utility Toolkit, opens windows, develops menus, and manages events. ● GLU, the GL Utility Library, which provides high level routines to handle complex mathematical and drawing operations. ● GLUI, the User Interface Library, which is completely integrated with the GLUT library. ○ The GLUT functions must be available for GLUI to operate properly. ○ GLUI provides sophisticated controls and menus to OpenGL applications.