SlideShare a Scribd company logo
1 of 17
Download to read offline
SBE 306B: Computer Systems III
(Computer Graphics)
Introduction
Dr. Ayman Eldeib
Systems & Biomedical
Engineering Department
Spring 2019
Computer Graphics Introduction
General Definition
 The use of a computer to produce and manipulate images on a screen.
 The creation and manipulation of models and images by a computer
 Modeling: Specification of shape and appearance in a way that
can be stored on a computer. Models are constructed from
geometric primitives - points, lines, and polygons - that are
specified by their vertices.
 Rendering: The creation of images from 2D/3D computer models.
Computer Graphics Introduction
What is CG?
 Imaging: representing 2D images.
 Modeling: representing 3D objects.
 Rendering: building 2D images from 3D models.
 Animation: simulating changes over time.
 Hardware: computer architecture for graphics.
Specialty
Computer Graphics Introduction
What is CG?
 Creating pictures on a computer
 Interacting with those pictures
 Displaying those pictures bigger, brighter, etc.
 Simulating physical phenomena
 Visualization of complex data
 Acquiring real-world geometry
 Video games
 …
Applications
Cont.
Computer Graphics Introduction
Applications
Entertainment (passive) Entertainment (active)
Cont.
What is CG?
Computer Graphics Introduction
Applications
Graphical User Interface Computer Aided Design
Cont.
What is CG?
Computer Graphics Introduction
Applications
Training / Education Training: Flight Simulator
Cont.
What is CG?
Computer Graphics Introduction
Applications
Scientific/Medical Visualization
Visible Human / 3D
Art / Photo Editing
Cont.
What is CG?
Computer Graphics Introduction
High-Level Graphics Pipeline
GPUCPU
Application
Processing
Geometry
Processing
Rasterization
Computer Graphics Introduction
 OpenGL is a state machine
 OpenGL is a software interface to graphics hardware, i.e. a graphics
API
 Software library
 Platform independent
 OpenGL provides tools to
 Construct shapes from geometric primitives (points, lines, bitmaps)
 Arrange objects in three-dimensional space and select vantage
point
 Calculate colors of objects by explicitly assigning colors, using
specified lighting conditions, by pasting textures, or some
combination of these
 OpenGL has become a standard because:
 It doesn’t try to do too much
Only renders the image, doesn’t manage windows, etc.
 It does enough: Useful rendering effects + high performance
OpenGL
Computer Graphics Introduction
OpenGL Utility Library (GLUT)
 Allows you to see what OpenGL produces
 Allows you to interact using keyboard and mouse
 Not a GUI kit
 Only provides simple menus
GLUT is a toolkit for window management
Computer Graphics Introduction
OpenGL / GLUT Conventions
 Functions in OpenGL start with gl
 Most functions just gl (e.g., glColor())
 Functions starting with glu are utility functions (e.g.,
gluLookAt())
 Note that GLU functions can always be composed
entirely from core GL functions
 Functions starting with glut are from the GLUT library,
built on top of OpenGL and WGL (Windows) or X
(Linux) for window management, mouse and keyboard
events, etc.
 Created and distributed as an entirely different
library
Computer Graphics Introduction
OpenGL / GLUT Conventions
 Function names indicate argument type and number
 Functions ending with f take floats
 Functions ending with i take ints
 Functions ending with b take bytes
 Functions ending with ub take unsigned bytes
 Functions that end with v take an array, i.e. v specifies
a pointer
 Most functions have multiple input types and
numbers, e.g. 2f,3f,4f,3i,v
Examples
 glColor3f() takes 3 floats
 glColor4fv() takes an array of 4 floats
Cont.
Computer Graphics Introduction
 OpenGL defined constants begin with GL_, use all capital
letters, and use underscores to separate words (like
GL_COLOR_BUFFER_BIT)
 OpenGL Type Definition starts with GL such as Glbyte,
Glshort, Glint, Glfloat, Gldouble, Glubyte, Glushort, and
GLuint
Cont.
OpenGL / GLUT Conventions
Computer Graphics Introduction
Example 1#include “glut.h”
void init (void)
{
gluOrtho2D (-1, 1, -1, 1);
}
void display (void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 0.0, 0.0);
glBegin(GL_POLYGON);
glVertex3f (0.5, 0.5, 0.0);
glVertex3f (-0.5, 0.5, 0.0);
glVertex3f (-0.5, -0.5, 0.0);
glVertex3f (0.5, -0.5, 0.0);
glEnd();
glFlush ();
}
void main (int argc, char** argv)
{
glutCreateWindow (“Red Square");
init ( );
glutDisplayFunc (display);
glutMainLoop ();
}
Computer Graphics Introduction
#include "glut.h"
float spin = 0.0;
void display ( void )
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 0.0, 0.0);
glPushMatrix();
glRotatef(spin,0.0,0.0,1.0);
glBegin(GL_POLYGON);
glVertex3f (-0.25, -0.25, 0.0);
glVertex3f (0.25, -0.25, 0.0);
glVertex3f (0.25, 0.25, 0.0);
glVertex3f (-0.25, 0.25, 0.0);
glEnd();
glPopMatrix();
glFlush ();
glutSwapBuffers();
}
void Timer(int value)
{
spin = spin + 1;
if (spin > 360.0)
spin = spin - 360.0;
glutPostRedisplay();
glutTimerFunc(30,Timer,0);
}
int main ( void )
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutCreateWindow("Rotating Cube");
gluOrtho2D (-0.5, 0.5, -0.5, 0.5);
glutDisplayFunc(display);
glutTimerFunc(0,Timer,0);
glutMainLoop();
return 0;
}
Example 2
Thank You

More Related Content

What's hot

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 Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics ConceptsSHAKOOR AB
 
Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)Tushar B Kute
 
Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Sharath Raj
 
ACM Mid-Southeast Slides
ACM Mid-Southeast SlidesACM Mid-Southeast Slides
ACM Mid-Southeast Slideskrinchan
 
aip shape detection and tracking using contours
aip shape detection and tracking using contoursaip shape detection and tracking using contours
aip shape detection and tracking using contoursSaeed Ullah
 
Computer graphics mcq question bank
Computer graphics mcq question bankComputer graphics mcq question bank
Computer graphics mcq question banksuthi
 
Computer Graphics Programes
Computer Graphics ProgramesComputer Graphics Programes
Computer Graphics ProgramesAbhishek Sharma
 
Geohash in mapping applications
Geohash in mapping applicationsGeohash in mapping applications
Geohash in mapping applicationsAlex Tumanoff
 
Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "Nikhil Jain
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionDataminingTools Inc
 
Games no Windows (FATEC 2015)
Games no Windows (FATEC 2015)Games no Windows (FATEC 2015)
Games no Windows (FATEC 2015)Fabrício Catae
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniquesMani Kanth
 

What's hot (20)

Unit 11. Graphics
Unit 11. GraphicsUnit 11. Graphics
Unit 11. Graphics
 
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 Graphics Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics Concepts
 
Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)
 
Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL
 
CG mini project
CG mini projectCG mini project
CG mini project
 
ACM Mid-Southeast Slides
ACM Mid-Southeast SlidesACM Mid-Southeast Slides
ACM Mid-Southeast Slides
 
aip shape detection and tracking using contours
aip shape detection and tracking using contoursaip shape detection and tracking using contours
aip shape detection and tracking using contours
 
Computer graphics mcq question bank
Computer graphics mcq question bankComputer graphics mcq question bank
Computer graphics mcq question bank
 
Computer Graphics Programes
Computer Graphics ProgramesComputer Graphics Programes
Computer Graphics Programes
 
Test
TestTest
Test
 
Python Manuel-R2021.pdf
Python Manuel-R2021.pdfPython Manuel-R2021.pdf
Python Manuel-R2021.pdf
 
Geohash in mapping applications
Geohash in mapping applicationsGeohash in mapping applications
Geohash in mapping applications
 
Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "Mini Project final report on " LEAKY BUCKET ALGORITHM "
Mini Project final report on " LEAKY BUCKET ALGORITHM "
 
Cad notes
Cad notesCad notes
Cad notes
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge Detection
 
Mcqs unity
Mcqs unityMcqs unity
Mcqs unity
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
Games no Windows (FATEC 2015)
Games no Windows (FATEC 2015)Games no Windows (FATEC 2015)
Games no Windows (FATEC 2015)
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 

Similar to 1 introduction computer graphics

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
 
CS 354 Introduction
CS 354 IntroductionCS 354 Introduction
CS 354 IntroductionMark Kilgard
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glutsimpleok
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptxssuser255bf1
 
Ball Collecting game report
Ball Collecting game report Ball Collecting game report
Ball Collecting game report Dileep Maurya
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programmingMohammed Romi
 
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 PlatformsPrabindh Sundareson
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsRup Chowdhury
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
01 first
01 first01 first
01 firstscythus
 

Similar to 1 introduction computer graphics (20)

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
 
OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL Introduction
 
Open gl
Open glOpen gl
Open gl
 
CS 354 Introduction
CS 354 IntroductionCS 354 Introduction
CS 354 Introduction
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glut
 
Introduction to 2D/3D Graphics
Introduction to 2D/3D GraphicsIntroduction to 2D/3D Graphics
Introduction to 2D/3D Graphics
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx
 
Bai 1
Bai 1Bai 1
Bai 1
 
Introduction to OpenGL.ppt
Introduction to OpenGL.pptIntroduction to OpenGL.ppt
Introduction to OpenGL.ppt
 
Ball Collecting game report
Ball Collecting game report Ball Collecting game report
Ball Collecting game report
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
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
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer Graphics
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
Opengl (1)
Opengl (1)Opengl (1)
Opengl (1)
 
01 first
01 first01 first
01 first
 
OpenGL
OpenGLOpenGL
OpenGL
 

More from cairo university

Tocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedTocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedcairo university
 
Tocci chapter 12 memory devices
Tocci chapter 12 memory devicesTocci chapter 12 memory devices
Tocci chapter 12 memory devicescairo university
 
Tocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitsTocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitscairo university
 
Tocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xTocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xcairo university
 
Tocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitsTocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitscairo university
 
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...cairo university
 
A15 sedra ch 15 memory circuits
A15  sedra ch 15 memory circuitsA15  sedra ch 15 memory circuits
A15 sedra ch 15 memory circuitscairo university
 
A14 sedra ch 14 advanced mos and bipolar logic circuits
A14  sedra ch 14 advanced mos and bipolar logic circuitsA14  sedra ch 14 advanced mos and bipolar logic circuits
A14 sedra ch 14 advanced mos and bipolar logic circuitscairo university
 
A13 sedra ch 13 cmos digital logic circuits
A13  sedra ch 13 cmos digital logic circuitsA13  sedra ch 13 cmos digital logic circuits
A13 sedra ch 13 cmos digital logic circuitscairo university
 
A09 sedra ch 9 frequency response
A09  sedra ch 9 frequency responseA09  sedra ch 9 frequency response
A09 sedra ch 9 frequency responsecairo university
 
5 sedra ch 05 mosfet revision
5  sedra ch 05  mosfet revision5  sedra ch 05  mosfet revision
5 sedra ch 05 mosfet revisioncairo university
 
Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01cairo university
 
Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01cairo university
 

More from cairo university (20)

Tocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedTocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extended
 
Tocci chapter 12 memory devices
Tocci chapter 12 memory devicesTocci chapter 12 memory devices
Tocci chapter 12 memory devices
 
Tocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitsTocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuits
 
Tocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xTocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified x
 
Tocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitsTocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuits
 
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
 
A15 sedra ch 15 memory circuits
A15  sedra ch 15 memory circuitsA15  sedra ch 15 memory circuits
A15 sedra ch 15 memory circuits
 
A14 sedra ch 14 advanced mos and bipolar logic circuits
A14  sedra ch 14 advanced mos and bipolar logic circuitsA14  sedra ch 14 advanced mos and bipolar logic circuits
A14 sedra ch 14 advanced mos and bipolar logic circuits
 
A13 sedra ch 13 cmos digital logic circuits
A13  sedra ch 13 cmos digital logic circuitsA13  sedra ch 13 cmos digital logic circuits
A13 sedra ch 13 cmos digital logic circuits
 
A09 sedra ch 9 frequency response
A09  sedra ch 9 frequency responseA09  sedra ch 9 frequency response
A09 sedra ch 9 frequency response
 
5 sedra ch 05 mosfet.ppsx
5  sedra ch 05  mosfet.ppsx5  sedra ch 05  mosfet.ppsx
5 sedra ch 05 mosfet.ppsx
 
5 sedra ch 05 mosfet
5  sedra ch 05  mosfet5  sedra ch 05  mosfet
5 sedra ch 05 mosfet
 
5 sedra ch 05 mosfet revision
5  sedra ch 05  mosfet revision5  sedra ch 05  mosfet revision
5 sedra ch 05 mosfet revision
 
Fields Lec 2
Fields Lec 2Fields Lec 2
Fields Lec 2
 
Fields Lec 1
Fields Lec 1Fields Lec 1
Fields Lec 1
 
Fields Lec 5&6
Fields Lec 5&6Fields Lec 5&6
Fields Lec 5&6
 
Fields Lec 4
Fields Lec 4Fields Lec 4
Fields Lec 4
 
Fields Lec 3
Fields Lec 3Fields Lec 3
Fields Lec 3
 
Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01
 
Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01
 

Recently uploaded

Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

1 introduction computer graphics

  • 1. SBE 306B: Computer Systems III (Computer Graphics) Introduction Dr. Ayman Eldeib Systems & Biomedical Engineering Department Spring 2019
  • 2. Computer Graphics Introduction General Definition  The use of a computer to produce and manipulate images on a screen.  The creation and manipulation of models and images by a computer  Modeling: Specification of shape and appearance in a way that can be stored on a computer. Models are constructed from geometric primitives - points, lines, and polygons - that are specified by their vertices.  Rendering: The creation of images from 2D/3D computer models.
  • 3. Computer Graphics Introduction What is CG?  Imaging: representing 2D images.  Modeling: representing 3D objects.  Rendering: building 2D images from 3D models.  Animation: simulating changes over time.  Hardware: computer architecture for graphics. Specialty
  • 4. Computer Graphics Introduction What is CG?  Creating pictures on a computer  Interacting with those pictures  Displaying those pictures bigger, brighter, etc.  Simulating physical phenomena  Visualization of complex data  Acquiring real-world geometry  Video games  … Applications Cont.
  • 5. Computer Graphics Introduction Applications Entertainment (passive) Entertainment (active) Cont. What is CG?
  • 6. Computer Graphics Introduction Applications Graphical User Interface Computer Aided Design Cont. What is CG?
  • 7. Computer Graphics Introduction Applications Training / Education Training: Flight Simulator Cont. What is CG?
  • 8. Computer Graphics Introduction Applications Scientific/Medical Visualization Visible Human / 3D Art / Photo Editing Cont. What is CG?
  • 9. Computer Graphics Introduction High-Level Graphics Pipeline GPUCPU Application Processing Geometry Processing Rasterization
  • 10. Computer Graphics Introduction  OpenGL is a state machine  OpenGL is a software interface to graphics hardware, i.e. a graphics API  Software library  Platform independent  OpenGL provides tools to  Construct shapes from geometric primitives (points, lines, bitmaps)  Arrange objects in three-dimensional space and select vantage point  Calculate colors of objects by explicitly assigning colors, using specified lighting conditions, by pasting textures, or some combination of these  OpenGL has become a standard because:  It doesn’t try to do too much Only renders the image, doesn’t manage windows, etc.  It does enough: Useful rendering effects + high performance OpenGL
  • 11. Computer Graphics Introduction OpenGL Utility Library (GLUT)  Allows you to see what OpenGL produces  Allows you to interact using keyboard and mouse  Not a GUI kit  Only provides simple menus GLUT is a toolkit for window management
  • 12. Computer Graphics Introduction OpenGL / GLUT Conventions  Functions in OpenGL start with gl  Most functions just gl (e.g., glColor())  Functions starting with glu are utility functions (e.g., gluLookAt())  Note that GLU functions can always be composed entirely from core GL functions  Functions starting with glut are from the GLUT library, built on top of OpenGL and WGL (Windows) or X (Linux) for window management, mouse and keyboard events, etc.  Created and distributed as an entirely different library
  • 13. Computer Graphics Introduction OpenGL / GLUT Conventions  Function names indicate argument type and number  Functions ending with f take floats  Functions ending with i take ints  Functions ending with b take bytes  Functions ending with ub take unsigned bytes  Functions that end with v take an array, i.e. v specifies a pointer  Most functions have multiple input types and numbers, e.g. 2f,3f,4f,3i,v Examples  glColor3f() takes 3 floats  glColor4fv() takes an array of 4 floats Cont.
  • 14. Computer Graphics Introduction  OpenGL defined constants begin with GL_, use all capital letters, and use underscores to separate words (like GL_COLOR_BUFFER_BIT)  OpenGL Type Definition starts with GL such as Glbyte, Glshort, Glint, Glfloat, Gldouble, Glubyte, Glushort, and GLuint Cont. OpenGL / GLUT Conventions
  • 15. Computer Graphics Introduction Example 1#include “glut.h” void init (void) { gluOrtho2D (-1, 1, -1, 1); } void display (void) { glClear (GL_COLOR_BUFFER_BIT); glColor3f (1.0, 0.0, 0.0); glBegin(GL_POLYGON); glVertex3f (0.5, 0.5, 0.0); glVertex3f (-0.5, 0.5, 0.0); glVertex3f (-0.5, -0.5, 0.0); glVertex3f (0.5, -0.5, 0.0); glEnd(); glFlush (); } void main (int argc, char** argv) { glutCreateWindow (“Red Square"); init ( ); glutDisplayFunc (display); glutMainLoop (); }
  • 16. Computer Graphics Introduction #include "glut.h" float spin = 0.0; void display ( void ) { glClearColor (0.0, 0.0, 0.0, 0.0); glClear (GL_COLOR_BUFFER_BIT); glColor3f (1.0, 0.0, 0.0); glPushMatrix(); glRotatef(spin,0.0,0.0,1.0); glBegin(GL_POLYGON); glVertex3f (-0.25, -0.25, 0.0); glVertex3f (0.25, -0.25, 0.0); glVertex3f (0.25, 0.25, 0.0); glVertex3f (-0.25, 0.25, 0.0); glEnd(); glPopMatrix(); glFlush (); glutSwapBuffers(); } void Timer(int value) { spin = spin + 1; if (spin > 360.0) spin = spin - 360.0; glutPostRedisplay(); glutTimerFunc(30,Timer,0); } int main ( void ) { glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutCreateWindow("Rotating Cube"); gluOrtho2D (-0.5, 0.5, -0.5, 0.5); glutDisplayFunc(display); glutTimerFunc(0,Timer,0); glutMainLoop(); return 0; } Example 2