SlideShare a Scribd company logo
CSC 307 1.0
Graphics Programming
Budditha Hettige
Department of Statistics and Computer Science
Graphics Programming
2Budditha Hettige
Common Uses for Computer
Graphics
• Applications for real-time 3D graphics range from
interactive games and simulations to data visualization
for scientific, medical, or business uses
– Military flight simulators
– Computer-aided design (CAD)
– Architectural or civil planning
– Scientific visualization
– Entertainment
3Budditha Hettige
Movies
Budditha Hettige 4
Games
Budditha Hettige 5
Simulation
Budditha Hettige 6
CAD-CAM & Design
Budditha Hettige 7
Architecture
Budditha Hettige 8
Virtual Reality
Budditha Hettige 9
Visualization
Budditha Hettige 10
Medical Imaging
Budditha Hettige 11
Graphics System
12
User ProgramUser Program IO DevicesIO Devices
Graphics API
Graphics
System
Graphics
System
Budditha Hettige
Graphics Designing
13Budditha Hettige
Graphics: Conceptual Model
Real Object
Real Object
Human Eye
Human Eye
Display
Device
Graphics System
Synthetic
Model
Synthetic
Camera
Real Light
Synthetic
Light Source
Budditha Hettige 14
OpenGL
• Standard specification defining a cross-language, cross-
platform API
• Is not a programming language
• Writing applications that produce 2D and 3D computer
graphics
• A software interface to graphics hardware
• Designed and optimized for the display and
manipulation of 3D graphics
• Developed by Silicon Graphics Inc. (SGI) in 1992
15Budditha Hettige
OpenGL-Graphics rendering API
• Rendering API
– High-quality color images composed of geometric
and image primitives
– Window system independent
– Operating system independent
• OpenGL Pipeline
16Budditha Hettige
OpenGL Architecture
17
Display
List
Polynomial
Evaluator
Per Vertex
Operations &
Primitive
Assembly
Rasterization
Per Fragment
Operations
Frame
Buffer
Texture
Memory
CPU
Pixel
Operations
Budditha Hettige
Software & Hardware Interfaces
18
Software Interface Hardware Interface
Budditha Hettige
OpenGL and Related APIs
19
GLUT
GLU
GL
GLX, AGL
or WGL
X, Win32, Mac O/S
software and/or hardware
application program
OpenGL Motif
widget or similar
Budditha Hettige
Related 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
• Initial header inclusions (for Windows)
– #include<windows.h>
– #include<gl/gl.h>
– #include<gl/glu.h>
– #include <GL/glut.h>
20Budditha Hettige
Function-Naming Conventions
• All OpenGL functions take the following
format
<Library prefix><Root command><Optional argument
count><Optional argument type>
21Budditha Hettige
OpenGL data types
22Budditha Hettige
2D Coordinates
23Budditha Hettige
Coordinate Clipping
24Budditha Hettige
Viewports
• Mapping Drawing Coordinates to Window
Coordinates
25
viewport defined as twice the size of the clipping area
Budditha Hettige
Viewports
26
viewport that matches the clipping area
Budditha Hettige
OpenGL 3-D coordinates
• Right-handed system
• From point of view of camera looking out into
scene:
 +X right, -X left
 +Y up, -Y down
 +Z behind camera, -Z in front
• Positive rotations are counterclockwise around
axis of rotation
27Budditha Hettige
28
OpenGL Geometric Primitives
GL_QUAD_STRIP
GL_POLYGON
GL_TRIANGLE_STRIP
GL_TRIANGLE_FAN
GL_POINTS
GL_LINES
GL_LINE_LOOPGL_LINE_STRIP
GL_TRIANGLES
GL_QUADS
Primitives are one- or two-dimensional entities or
surfaces such as points, lines, and polygons
Budditha Hettige
The Vertex—A Position in Space
• Each corner of the any primitive is called a
vertex. Ex: three-dimensional cube consists of
six two dimensional squares, each placed on a
separate face
29Budditha Hettige
Projections: Getting 3D to 2D
• Orthographic Projections
• Perspective Projections
30Budditha Hettige
RGB Color Space
Green
(1,0,0)
Blue
(0,0,1)
Red
(1,0,0)
Yellow
(1,1,0)
Magenta
(1,0,1)
Blk
Cyan
(0,1,1)
White
(1,1,1)
G
B
R
Image: Pixel maps to color
Budditha Hettige 31
Common Composite Colors
32Budditha Hettige

More Related Content

What's hot (20)

PPT
Computer graphics1
poornima sugumaran
 
PPT
Introduction to computer graphics
Amandeep Kaur
 
PPTX
Applications of computer graphics
-jyothish kumar sirigidi
 
PPT
Introduction to computer graphics
Partnered Health
 
PPT
Lecture applications of cg
avelraj
 
PPTX
Application of computer graphics and input devices
Mani Kanth
 
PPTX
Introduction to computer graphics
Kamal Acharya
 
PPTX
Computer Graphics
NANDINI SHARMA
 
PPTX
Overview of Computer Graphics
United International University
 
PPT
Computer graphics
katherineschuster
 
PDF
Application of computer graphics technique to computer system assembling
Alexander Decker
 
PPT
Introduction to 2D/3D Graphics
Prabindh Sundareson
 
PPTX
B. SC CSIT Computer Graphics Unit1.1 By Tekendra Nath Yogi
Tekendra Nath Yogi
 
DOCX
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
tarun kumar sharma
 
PPTX
Application of computer graphic
alldesign
 
PPT
applications of computer graphics
Aaina Katyal
 
PPT
lecture1 introduction to computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
Introduction to Computer Graphics(1)
HiteshJain007
 
PPTX
Introduction to Computer Graphics
Megha Sharma
 
PPT
unit-1-intro
Docent Education
 
Computer graphics1
poornima sugumaran
 
Introduction to computer graphics
Amandeep Kaur
 
Applications of computer graphics
-jyothish kumar sirigidi
 
Introduction to computer graphics
Partnered Health
 
Lecture applications of cg
avelraj
 
Application of computer graphics and input devices
Mani Kanth
 
Introduction to computer graphics
Kamal Acharya
 
Computer Graphics
NANDINI SHARMA
 
Overview of Computer Graphics
United International University
 
Computer graphics
katherineschuster
 
Application of computer graphics technique to computer system assembling
Alexander Decker
 
Introduction to 2D/3D Graphics
Prabindh Sundareson
 
B. SC CSIT Computer Graphics Unit1.1 By Tekendra Nath Yogi
Tekendra Nath Yogi
 
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
tarun kumar sharma
 
Application of computer graphic
alldesign
 
applications of computer graphics
Aaina Katyal
 
lecture1 introduction to computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Introduction to Computer Graphics(1)
HiteshJain007
 
Introduction to Computer Graphics
Megha Sharma
 
unit-1-intro
Docent Education
 

Similar to Introduction to Computer Graphics (20)

PDF
Graphics Programming OpenGL & GLUT in Code::Blocks
Budditha Hettige
 
PPTX
CGV.pptx
shivaprasad746564
 
PPTX
Graphics Libraries
Prachi Mishra
 
PDF
CG3_ch3+ch4computergraphicsbreesenhan.pdf
VikramBhathal
 
PPTX
2D graphics
Muhammad Rashid
 
PDF
18csl67 vtu lab manual
NatsuDragoneel5
 
PPT
openGL basics for sample program (1).ppt
HIMANKMISHRA2
 
PPT
openGL basics for sample program.ppt
HIMANKMISHRA2
 
DOCX
Computer graphics workbook
Muhammadalizardari
 
PDF
Opengl basics
pushpa latha
 
PDF
Viewing
Budditha Hettige
 
PPT
Introduction to OpenGL.ppt
16118MdFirozAhmed
 
PDF
Bouncing ball content management system project report.pdf
Kamal Acharya
 
PPT
Programming with OpenGL
Syed Zaid Irshad
 
PDF
OpenGL 3D Drawing
Budditha Hettige
 
PPT
Opengl (1)
ch samaram
 
PPTX
Chapter02 graphics-programming
Mohammed Romi
 
PDF
Airplane game management system project report .pdf
Kamal Acharya
 
PPTX
Cgp lecture2 graphics_standard, opengl
Javkhlan Rentsendorj
 
PDF
Tictactoe game management system project report.pdf
Kamal Acharya
 
Graphics Programming OpenGL & GLUT in Code::Blocks
Budditha Hettige
 
Graphics Libraries
Prachi Mishra
 
CG3_ch3+ch4computergraphicsbreesenhan.pdf
VikramBhathal
 
2D graphics
Muhammad Rashid
 
18csl67 vtu lab manual
NatsuDragoneel5
 
openGL basics for sample program (1).ppt
HIMANKMISHRA2
 
openGL basics for sample program.ppt
HIMANKMISHRA2
 
Computer graphics workbook
Muhammadalizardari
 
Opengl basics
pushpa latha
 
Introduction to OpenGL.ppt
16118MdFirozAhmed
 
Bouncing ball content management system project report.pdf
Kamal Acharya
 
Programming with OpenGL
Syed Zaid Irshad
 
OpenGL 3D Drawing
Budditha Hettige
 
Opengl (1)
ch samaram
 
Chapter02 graphics-programming
Mohammed Romi
 
Airplane game management system project report .pdf
Kamal Acharya
 
Cgp lecture2 graphics_standard, opengl
Javkhlan Rentsendorj
 
Tictactoe game management system project report.pdf
Kamal Acharya
 
Ad

More from Budditha Hettige (20)

PDF
Algorithm analysis
Budditha Hettige
 
PDF
Sorting
Budditha Hettige
 
PDF
Link List
Budditha Hettige
 
PDF
02 Stack
Budditha Hettige
 
PDF
Data Structures 01
Budditha Hettige
 
PDF
Drawing Fonts
Budditha Hettige
 
PDF
Texture Mapping
Budditha Hettige
 
PDF
Lighting
Budditha Hettige
 
PDF
2D Drawing
Budditha Hettige
 
PPTX
Computer System Architecture Lecture Note 9 IO fundamentals
Budditha Hettige
 
PPTX
Computer System Architecture Lecture Note 8.1 primary Memory
Budditha Hettige
 
PPTX
Computer System Architecture Lecture Note 8.2 Cache Memory
Budditha Hettige
 
PPTX
Computer System Architecture Lecture Note 7 addressing
Budditha Hettige
 
PPT
Computer System Architecture Lecture Note 6: hardware performance
Budditha Hettige
 
PPT
Computer System Architecture Lecture Note 5: microprocessor technology
Budditha Hettige
 
PPT
Computer System Architecture Lecture Note 3: computer architecture
Budditha Hettige
 
PPT
Computer System Architecture Lecture Note 2: History
Budditha Hettige
 
PPT
Computer System Architecture Lecture Note 1: introduction
Budditha Hettige
 
PPT
Computer System Architecture Lecture Note 4: intel microprocessors
Budditha Hettige
 
Algorithm analysis
Budditha Hettige
 
Link List
Budditha Hettige
 
Data Structures 01
Budditha Hettige
 
Drawing Fonts
Budditha Hettige
 
Texture Mapping
Budditha Hettige
 
2D Drawing
Budditha Hettige
 
Computer System Architecture Lecture Note 9 IO fundamentals
Budditha Hettige
 
Computer System Architecture Lecture Note 8.1 primary Memory
Budditha Hettige
 
Computer System Architecture Lecture Note 8.2 Cache Memory
Budditha Hettige
 
Computer System Architecture Lecture Note 7 addressing
Budditha Hettige
 
Computer System Architecture Lecture Note 6: hardware performance
Budditha Hettige
 
Computer System Architecture Lecture Note 5: microprocessor technology
Budditha Hettige
 
Computer System Architecture Lecture Note 3: computer architecture
Budditha Hettige
 
Computer System Architecture Lecture Note 2: History
Budditha Hettige
 
Computer System Architecture Lecture Note 1: introduction
Budditha Hettige
 
Computer System Architecture Lecture Note 4: intel microprocessors
Budditha Hettige
 
Ad

Recently uploaded (20)

PPTX
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PPTX
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PPTX
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPT
digestive system for Pharm d I year HAP
rekhapositivity
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PPTX
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
LEGAL ASPECTS OF PSYCHIATRUC NURSING.pptx
PoojaSen20
 
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
digestive system for Pharm d I year HAP
rekhapositivity
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
LEGAL ASPECTS OF PSYCHIATRUC NURSING.pptx
PoojaSen20
 

Introduction to Computer Graphics