SlideShare a Scribd company logo
1 of 14
Introduction to OpenGL
Syed Maisam Ali
Azmeen Gadit
What is Open GL
• Open Graphics Library is a cross-language,
cross-platform application programming
interface for rendering 2D and 3D vector
graphics. The API is typically used to
interact with a graphics processing unit, to
achieve hardware-accelerated rendering.
What Is OpenGL?
• Graphics rendering API
– high-quality color images composed of
geometric and image primitives
– window system independent
– operating system independent
OpenGL as a Renderer
• Geometric primitives
– points, lines and polygons
– Image Primitives
– images and bitmaps
• separate pipeline for images and geometry
– linked through texture mapping
• Rendering depends on state
– colors, materials, light sources, etc.
Relate APIs
• AGL, GLX, WGL
– glue between OpenGL and windowing systems
• GLU (OpenGL Utility Library)
– part of OpenGL
– NURBS, tessellators, quadric shapes, etc
• GLUT (OpenGL Utility Toolkit)
– portable windowing API
– not officially part of OpenGL
Preliminaries
• Header Files
– #include <GL gl.h>
– #include <GL glu.h>
– #include <GL glut.h>
• Libraries
• Enumerated types
• OpenGL defines numerous types for
compatibility
– GLfloat, GLint, GLenum, etc.
We use 3 sets of libraries in our
OpenGL programs:
• Core OpenGL (GL)
• OpenGL Utility Library (GLU)
• OpenGL Utilities Toolkit (GLUT
Core OpenGL (GL)
• It consists of hundreds of commands, which
begin with a prefix "gl" (e.g., glColor,
glVertex, glTranslate, glRotate). The Core
OpenGL models an object via a set of
geometric primitives such as point, line and
polygon.
Sample is here!
• glBegin(GL_TRIANGLES); // Each set of 3 vertices form a
triangle
• glColor3f(0.0f, 0.0f, 1.0f); // Blue
• glVertex2f(0.1f, -0.6f);
• glVertex2f(0.7f, -0.6f);
• glVertex2f(0.4f, -0.1f);
•
• glColor3f(1.0f, 0.0f, 0.0f); // Red
• glVertex2f(0.3f, -0.4f);
• glColor3f(0.0f, 1.0f, 0.0f); // Green
• glVertex2f(0.9f, -0.4f);
• glColor3f(0.0f, 0.0f, 1.0f); // Blue
• glVertex2f(0.6f, -0.9f);
• glEnd();
OpenGL Utility Library (GLU)
• built on-top of the core OpenGL to provide
important utilities (such as setting camera
view and projection) and more building
models (such as qradric surfaces and
polygon tessellation). GLU commands start
with a prefix "glu" (e.g., gluLookAt,
gluPerspective).
OpenGL Utilities Toolkit
(GLUT)
• OpenGL is designed to be independent of
the windowing system or operating system.
GLUT is needed to interact with the
Operating System (such as creating a
window, handling key and mouse inputs); it
also provides more building models (such
as sphere and torus). GLUT commands start
with a prefix of "glut" (e.g.,
glutCreatewindow, glutMouseFunc).
Sample is here
• int main(int argc, char** argv) {
• glutInit(&argc, argv); // Initialize GLUT
• glutCreateWindow("Vertex, Primitive & Color"); //
Create window with the given title
• glutInitWindowSize(320, 320); // Set the window's
initial width & height
• glutInitWindowPosition(50, 50); // Position the window's
initial top-left corner
• glutDisplayFunc(display); // Register callback
handler for window re-paint event
• initGL(); // Our own OpenGL initialization
• glutMainLoop(); // Enter the event-processing
loop
• return 0;}
CONCLUSION
THANK YOU

More Related Content

What's hot

OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
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 OpenGLSharath Raj
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notessmruti sarangi
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android Arvind Devaraj
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGLMegha V
 
computer graphics
computer graphicscomputer graphics
computer graphicsashpri156
 
3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer GraphicsFaraz Akhtar
 
Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3SIMONTHOMAS S
 
Contrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalizationContrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalizationEr. Nancy
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Enginerajdeep
 
Image Processing and Computer Vision
Image Processing and Computer VisionImage Processing and Computer Vision
Image Processing and Computer VisionSilicon Mentor
 
Digital Image Processing: An Introduction
Digital Image Processing: An IntroductionDigital Image Processing: An Introduction
Digital Image Processing: An IntroductionMostafa G. M. Mostafa
 

What's hot (20)

OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
Baiscs of OpenGL
Baiscs of OpenGLBaiscs of OpenGL
Baiscs of OpenGL
 
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
 
Computer vision
Computer visionComputer vision
Computer vision
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGL
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
computer graphics
computer graphicscomputer graphics
computer graphics
 
OpenGL L01-Primitives
OpenGL L01-PrimitivesOpenGL L01-Primitives
OpenGL L01-Primitives
 
Computer Vision
Computer VisionComputer Vision
Computer Vision
 
face detection
face detectionface detection
face detection
 
3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics
 
Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3Cs8092 computer graphics and multimedia unit 3
Cs8092 computer graphics and multimedia unit 3
 
Contrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalizationContrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalization
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Image Processing and Computer Vision
Image Processing and Computer VisionImage Processing and Computer Vision
Image Processing and Computer Vision
 
Digital Image Processing: An Introduction
Digital Image Processing: An IntroductionDigital Image Processing: An Introduction
Digital Image Processing: An Introduction
 

Similar to Open Graphics Library

OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading LanguageJungsoo Nam
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programmingMohammed Romi
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.pptHIMANKMISHRA2
 
Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxAnandM62785
 
OpenGLES Android Graphics
OpenGLES Android GraphicsOpenGLES Android Graphics
OpenGLES Android GraphicsArvind Devaraj
 
GL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdfGL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdfshaikhshehzad024
 
The Ring programming language version 1.7 book - Part 172 of 196
The Ring programming language version 1.7 book - Part 172 of 196The Ring programming language version 1.7 book - Part 172 of 196
The Ring programming language version 1.7 book - Part 172 of 196Mahmoud Samir Fayed
 
Richard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleRichard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleAxway Appcelerator
 
The Ring programming language version 1.5 book - Part 24 of 31
The Ring programming language version 1.5 book - Part 24 of 31The Ring programming language version 1.5 book - Part 24 of 31
The Ring programming language version 1.5 book - Part 24 of 31Mahmoud Samir Fayed
 

Similar to Open Graphics Library (20)

september11.ppt
september11.pptseptember11.ppt
september11.ppt
 
Grafika komputer 2
Grafika komputer 2Grafika komputer 2
Grafika komputer 2
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptx
 
OpenGLES Android Graphics
OpenGLES Android GraphicsOpenGLES Android Graphics
OpenGLES Android Graphics
 
Hill ch2ed3
Hill ch2ed3Hill ch2ed3
Hill ch2ed3
 
GL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdfGL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdf
 
Open gl basics
Open gl basicsOpen gl basics
Open gl basics
 
The Ring programming language version 1.7 book - Part 172 of 196
The Ring programming language version 1.7 book - Part 172 of 196The Ring programming language version 1.7 book - Part 172 of 196
The Ring programming language version 1.7 book - Part 172 of 196
 
Programming with OpenGL
Programming with OpenGLProgramming with OpenGL
Programming with OpenGL
 
Richard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleRichard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL Module
 
Intro to OpenGL ES 2.0
Intro to OpenGL ES 2.0Intro to OpenGL ES 2.0
Intro to OpenGL ES 2.0
 
The Ring programming language version 1.5 book - Part 24 of 31
The Ring programming language version 1.5 book - Part 24 of 31The Ring programming language version 1.5 book - Part 24 of 31
The Ring programming language version 1.5 book - Part 24 of 31
 
Development with OpenGL and Qt
Development with OpenGL and QtDevelopment with OpenGL and Qt
Development with OpenGL and Qt
 
Graphics Libraries
Graphics LibrariesGraphics Libraries
Graphics Libraries
 

More from Azmeen Gadit

Comparative Analysis between Waterfall and Agile Research Report
Comparative Analysis between Waterfall and Agile Research ReportComparative Analysis between Waterfall and Agile Research Report
Comparative Analysis between Waterfall and Agile Research ReportAzmeen Gadit
 
Comparative Analysis between waterfall model and agile model (for research pa...
Comparative Analysis between waterfall model and agile model (for research pa...Comparative Analysis between waterfall model and agile model (for research pa...
Comparative Analysis between waterfall model and agile model (for research pa...Azmeen Gadit
 
Comparative Analysis between Water fall Model and Agile Model (Research Propo...
Comparative Analysis between Water fall Model and Agile Model (Research Propo...Comparative Analysis between Water fall Model and Agile Model (Research Propo...
Comparative Analysis between Water fall Model and Agile Model (Research Propo...Azmeen Gadit
 
Importance of communication skill in project management and at workplace
Importance of communication skill in project management and at workplaceImportance of communication skill in project management and at workplace
Importance of communication skill in project management and at workplaceAzmeen Gadit
 
Fortune Teller Project on C++ Proposal
Fortune Teller Project on C++ Proposal Fortune Teller Project on C++ Proposal
Fortune Teller Project on C++ Proposal Azmeen Gadit
 
Presentation Skills Research Paper ppt
Presentation Skills Research Paper pptPresentation Skills Research Paper ppt
Presentation Skills Research Paper pptAzmeen Gadit
 
Blood Bank Management System Project Proposal
Blood Bank Management System Project ProposalBlood Bank Management System Project Proposal
Blood Bank Management System Project ProposalAzmeen Gadit
 

More from Azmeen Gadit (8)

Comparative Analysis between Waterfall and Agile Research Report
Comparative Analysis between Waterfall and Agile Research ReportComparative Analysis between Waterfall and Agile Research Report
Comparative Analysis between Waterfall and Agile Research Report
 
Comparative Analysis between waterfall model and agile model (for research pa...
Comparative Analysis between waterfall model and agile model (for research pa...Comparative Analysis between waterfall model and agile model (for research pa...
Comparative Analysis between waterfall model and agile model (for research pa...
 
Comparative Analysis between Water fall Model and Agile Model (Research Propo...
Comparative Analysis between Water fall Model and Agile Model (Research Propo...Comparative Analysis between Water fall Model and Agile Model (Research Propo...
Comparative Analysis between Water fall Model and Agile Model (Research Propo...
 
Importance of communication skill in project management and at workplace
Importance of communication skill in project management and at workplaceImportance of communication skill in project management and at workplace
Importance of communication skill in project management and at workplace
 
Fortune Teller Project on C++ Proposal
Fortune Teller Project on C++ Proposal Fortune Teller Project on C++ Proposal
Fortune Teller Project on C++ Proposal
 
Presentation Skills Research Paper ppt
Presentation Skills Research Paper pptPresentation Skills Research Paper ppt
Presentation Skills Research Paper ppt
 
Blood Bank Management System Project Proposal
Blood Bank Management System Project ProposalBlood Bank Management System Project Proposal
Blood Bank Management System Project Proposal
 
Fitness App ppt
Fitness App pptFitness App ppt
Fitness App ppt
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Open Graphics Library

  • 1. Introduction to OpenGL Syed Maisam Ali Azmeen Gadit
  • 2. What is Open GL • Open Graphics Library is a cross-language, cross-platform application programming interface for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit, to achieve hardware-accelerated rendering.
  • 3. What Is OpenGL? • Graphics rendering API – high-quality color images composed of geometric and image primitives – window system independent – operating system independent
  • 4. OpenGL as a Renderer • Geometric primitives – points, lines and polygons – Image Primitives – images and bitmaps • separate pipeline for images and geometry – linked through texture mapping • Rendering depends on state – colors, materials, light sources, etc.
  • 5. Relate APIs • AGL, GLX, WGL – glue between OpenGL and windowing systems • GLU (OpenGL Utility Library) – part of OpenGL – NURBS, tessellators, quadric shapes, etc • GLUT (OpenGL Utility Toolkit) – portable windowing API – not officially part of OpenGL
  • 6. Preliminaries • Header Files – #include <GL gl.h> – #include <GL glu.h> – #include <GL glut.h> • Libraries • Enumerated types • OpenGL defines numerous types for compatibility – GLfloat, GLint, GLenum, etc.
  • 7. We use 3 sets of libraries in our OpenGL programs: • Core OpenGL (GL) • OpenGL Utility Library (GLU) • OpenGL Utilities Toolkit (GLUT
  • 8. Core OpenGL (GL) • It consists of hundreds of commands, which begin with a prefix "gl" (e.g., glColor, glVertex, glTranslate, glRotate). The Core OpenGL models an object via a set of geometric primitives such as point, line and polygon.
  • 9. Sample is here! • glBegin(GL_TRIANGLES); // Each set of 3 vertices form a triangle • glColor3f(0.0f, 0.0f, 1.0f); // Blue • glVertex2f(0.1f, -0.6f); • glVertex2f(0.7f, -0.6f); • glVertex2f(0.4f, -0.1f); • • glColor3f(1.0f, 0.0f, 0.0f); // Red • glVertex2f(0.3f, -0.4f); • glColor3f(0.0f, 1.0f, 0.0f); // Green • glVertex2f(0.9f, -0.4f); • glColor3f(0.0f, 0.0f, 1.0f); // Blue • glVertex2f(0.6f, -0.9f); • glEnd();
  • 10. OpenGL Utility Library (GLU) • built on-top of the core OpenGL to provide important utilities (such as setting camera view and projection) and more building models (such as qradric surfaces and polygon tessellation). GLU commands start with a prefix "glu" (e.g., gluLookAt, gluPerspective).
  • 11. OpenGL Utilities Toolkit (GLUT) • OpenGL is designed to be independent of the windowing system or operating system. GLUT is needed to interact with the Operating System (such as creating a window, handling key and mouse inputs); it also provides more building models (such as sphere and torus). GLUT commands start with a prefix of "glut" (e.g., glutCreatewindow, glutMouseFunc).
  • 12. Sample is here • int main(int argc, char** argv) { • glutInit(&argc, argv); // Initialize GLUT • glutCreateWindow("Vertex, Primitive & Color"); // Create window with the given title • glutInitWindowSize(320, 320); // Set the window's initial width & height • glutInitWindowPosition(50, 50); // Position the window's initial top-left corner • glutDisplayFunc(display); // Register callback handler for window re-paint event • initGL(); // Our own OpenGL initialization • glutMainLoop(); // Enter the event-processing loop • return 0;}