SlideShare a Scribd company logo
COMPUTER
GRAPHICS
Adri Jovin J.J.
Assistant Professor
Department of Information Technology
SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY
1
ONE DAY NATIONAL SEMINAR
ON
IES COLLEGE OF ENGINEERING
OUTLINE
2
Basics of Computer Graphics
3D Concepts
Color Profiles & Animation
GPU
OpenGL
Basics of Computer Graphics
3
Computing Classification System
CCS Computing Methodologies Computer Graphics
Geometry
+
Principles of Engineering Graphics
+
Mapping with Display Device
What is Computer Graphics
4
• The term computer graphics describes any
use of computers to create and manipulate
images.
• can be two- or three-dimensional
• has a wide range of application
Computer Aided Design
5
Presentation Graphics
6
Computer Art
7
Entertainment
8
Education and Training
9
Visualization
10
Image Processing
11
Graphical User Interface
12
Graphics Devices and
Output Primitives
13
Raster Scan Displays
14
Architecture
15
Random Scan Displays
16
Architecture
17
Color CRT Monitor
18
Color CRT Monitor
19
Flat Panel Displays
20
Input Devices
21
Trackball
22
Space ball
23
Joystick
24
Image Scanner
25
Touch Panel
26
Light Pen
27
Points and Lines
28
• setpixel(x,y) – load a specified color point in the location
specified by x and y
• getpixel(x,y) – retrieve the current frame buffer intensity
Line drawing algorithms
29
cxmy  .
12
12
xx
yy
m


 11 xmyc 
m
y
x

 xmy 
DDA Algorithm
30
• Digital Differential Analyzer
• Consider positive slope and the slope is less
than or equal to 1.
• We sample at unit x interval
• For lines with positive slope, greater than 1,
the roles of x and y are reversed
myy kk 1
m
xx kk
1
1 
DDA Algorithm (Contd..)
31
• If the process start from right end point, we
have
• Therefore
• Similarly, for slope greater than 1,
myy kk 1
1x
m
xx kk
1
1 
Bresenham Line Drawing Algorithm
32
2D Transformation - Translation
33
y
x
P
P
2D Transformation - Translation
34
y
x
y
x
TPP 
2D Transformation - Rotation
35
y
x

P
P
PRP .





 



cossin
sincos
R
2D Transformation – Uniform Scaling
36




















y
x
s
s
y
x
y
x
.
0
0
PSP .
2D Transformation – Differential
Scaling
37
2D Transformation – Reflection
38
x
y
Original Position
Reflected Position
1
2 3
1’
2’ 3’











100
010
001
2D Transformation – Shear
39
x
y
(0,1) (1,1)
(1,0)(0,0) x
y
(1,0)(0,0)
(2,1) (3,1)










100
010
01 xsh yshxx x.
yy 
Composite 2D Transformation
40
(a)
Original Position of the
Object and Pivot Point
(b)
Translation of object to
take the pivot point to
origin
(c)
Rotation about the origin
(d)
Translation of object to
original pivot point
Line Clipping
41
1001 1000 1010
0001
0000
Window
0010
0101 0100 0110
Line Clipping
42
P1
P2
P’2
P’’2
P’1
P4
P3
P’3
Window
Polygon Clipping
43
Original Polygon Clip Left Clip Right
Clip Bottom Clip Top
3D Concepts and Object
Representations
44
3D Display Methods
45
• Parallel Projection
• Perspective Projection
• Depth Cueing
• Visible Line and Surface Identification
Parallel Projection
46
Perspective Projection
47
Depth Cueing
48
Visible Line and Surface Identification
49
3D Graphic Packages
50
Modeling
Transformation
Viewing and
Projection
Transformation
Workstation
Transformation
Modeling
Coordinates
World
Coordinates
Projection
Coordinates
Device
Coordinates
3D Object Representations
51
• Boundary representations (B-reps)
– describe a three-dimensional object as a set
of surfaces that separate the object interior
from the environment.
• Space-partitioning representations
– used to describe interior properties, by
partitioning the spatial region containing an
object into a set of small, non-overlapping,
contiguous solids (usually cubes).
Polygon Surfaces
52
• most commonly used boundary presentation
• set of surface polygons enclose the object
interior
• Used in most graphics systems
• simplifies and speeds up the surface rendering
and display of objects
Polygon Tables
53
Plane Equations
54
• Ax + By + Cz + D = 0, where (x,y,z) is any point
on the plane.
33
22
11
1
1
1
zx
zx
zx
B 
33
22
11
1
1
1
zy
zy
zy
A 
1
1
1
33
22
11
yx
yx
yx
C 
333
222
111
zyx
zyx
zyx
D 
Polygon Meshes
55
Quadric Surfaces
56
• Second Degree equations
• Sphere
• Ellipsoid
Quadric Surfaces (Contd.)
57
• Torus
Super Quadrics
58
• Super ellipse
Super Quadrics
59
• Superellipsoid
Blobby Objects
60
• Metaball Model
• Soft Object Model
Spline Representations
61
• Interpolation Model
• Approximation Model
Parametric Continuity
62
• Zero-order
 Means simply that the curve meets
• First – order
 The first derivatives of two adjoining curve functions are equal
(or) the tangents are shared
• Second –order
 Both the first order and the second order derivatives of two
adjoining curve functions are equal
Bezier Surfaces
63
B-Spline Curves and Surfaces
64
• B- Spline Curves
B-Spline surfaces
65
NURBS
66
• Non-uniform Rational B-Spline
• Use of non-uniform knot-vector
representations for constructing rational B-
splines
Color Models
67
RGB Color Model
68
• Based on “tristimulus theory of vision”
– eyes perceive color through the stimulation of three
visual pigments in the cones of the retina
– peak sensitivity at wavelengths of about 630 nm (red),
530 nm (green), and 450 nm (blue)
• Represented as a unit cube defined on R, G, B
axes
• Color Ck = RR + GG + BB
RGB Color Model (Contd..)
69
"Cie Chart with sRGB gamut by spigget" by Spigget - Own work. Licensed
under Creative Commons Attribution-Share Alike 3.0 via Wikimedia
Commons -
http://commons.wikimedia.org/wiki/File:Cie_Chart_with_sRGB_gamut_
by_spigget.png#mediaviewer/File:Cie_Chart_with_sRGB_gamut_by_spig
get.png
YIQ Color Model
70
• National Television System Committee (NTSC)
color model for forming the composite video
signal
YIQ Color Model (Contd…)
71
"YIQ IQ plane" by Tonyle - Own work. Licensed under
Creative Commons Attribution-Share Alike 3.0 via
Wikimedia Commons -
http://commons.wikimedia.org/wiki/File:YIQ_IQ_plane.s
vg#mediaviewer/File:YIQ_IQ_plane.svg
CMY Color Model
72
• Defined with the primary colors cyan, magenta,
and yellow
• Useful for describing color output to hard-copy
devices
CMY Color Model (Contd…)
73
HSV Color Model
74
• Color parameters in this model are hue ( H ) ,
saturation( S ) and value( V )
• 3D representation is derived from RGB Cube.
Animations
75
Animation Design Steps
76
• Storyboard Layout
• Object Definitions
• Keyframe Specification
• Generation of in-between frames
Storyboard
77
• Storyboard is an outline of the action
• Defines the motion sequence as a set of basic events
that are to take place
Object Definition
78
• Object definition is given for each participant in
the action
• Basic shapes, such as polygons or splines
• Associated movements for each object are
specified along with the shape.
Keyframe
79
• Keyframe is a detailed drawing of the scene at a
certain time in the animation sequence
• Each object is positioned according to the time
for that frame
In-betweens
80
• In-betweens are the intermediate frames
between the key frames
• Determined by the media to be used to display
the animation
– Film : 24 fps
– Graphics Terminals : 30 to 60 fps
Other Tasks
81
• Motion Verification
• Editing and Production
• Synchronization of Sound Track
General Computer Animation
82
• Some steps in the development of an animation
sequence are well-suited to computer solution.
– Object Manipulation and Rendering
– Camera Motions ( Zooming, Tilting etc..)
– Generation of In-betweens
– Store and Manage Object Database
Raster Animations
83
• On raster systems, we can generate real-time
animation in limited applications using raster
operations.
• Simple 2D/ 3D transformations
• Color Table Transformation
Key-frame Systems
84
• Morphing
– Transformation of object shapes from one form to another
Morphing
85
Morphing
86
Graphics Processing Unit
(GPU)
87
Graphics Processing Unit (GPU)
88
• Also known as Visual Processing Unit
• Designed to rapidly manipulate and alter memory to
accelerate the creation of images in a frame buffer
intended for output to a display
• Used in embedded systems, mobile phones, personal
computers, workstations, and game consoles
• Popularized by NVIDIA in 1999, who marketed the
GeForce 256 as "the world's first GPU"
Graphics Processing Unit (GPU)
89
90
OpenGL
91
• Developed by Silicon Graphics in early 90’s
• Most widely-used open graphics standard in
the world
• Supports both 2D and 3D Graphics APIs
OpenGL (Contd..)
92
• OpenGL applications use the window
system’s window, input, and event
mechanism
• GLU supports quadrics, NURBS, complex
polygons, matrix utilities, and more
Playing the OpenGL Game
93
glutInit()
Used to initialize the GLUT library
Usage:
void glutInit(int *argcp, char **argv);
Description:
Initialize the GLUT library and negotiate a session with the window
system.
Playing the OpenGL Game..
94
glutInitWindowSize()
Set the initial window size
Usage:
void glutInitWindowSize(int width, int height);
Description:
Windows created by glutCreateWindow will be requested to be
created with the current initial window size.
Playing the OpenGL Game..
95
glutInitWindowPosition()
Set the initial window position
Usage:
void glutInitWindowPosition(int x, int y);
Description:
Windows created by glutCreateWindow will be requested to be
created with the current initial window position.
Playing the OpenGL Game..
96
glutInitDisplayMode()
Set the initial window display mode.
Usage:
void glutInitDisplayMode(unsigned int mode);
mode - Display mode, normally the bitwise OR-ing of GLUT
display mode bit masks
Description:
Used when creating top-level windows, subwindows, and overlays
to determine the OpenGL display mode for the to-be-created
window or overlay.
Playing the OpenGL Game..
97
glutCreateWindow()
Creates a top-level window.
Usage:
int glutCreateWindow(char *name);
Description:
Creates a top-level window. The intent is that the window system will
label the window with the name.
Playing the OpenGL Game..
98
glutDisplayFunc()
Sets the display callback for the current window.
Usage:
void glutDisplayFunc(void (*func)(void));
Description:
Sets the display callback for the current window.
When GLUT determines that the normal plane for the window needs
to be redisplayed, the display callback for the window is called.
Before the callback, the current window is set to the window needing
to be redisplayed and (if no overlay display callback is registered)
the layer in use is set to the normal plane. The display callback is
called with no parameters.
Playing the OpenGL Game..
99
glutMainLoop()
Enters the GLUT event processing loop.
Usage:
void glutMainLoop(void);
Description:
Enters the GLUT event processing loop.
This routine should be called at most once in a GLUT program.
Once called, this routine will never return.
Playing the OpenGL Game..
100
glClearColor()
Specify clear values for the color buffers.
Usage:
void glClearColor(GLclampf red, GLclampf green, GLclampf blue,
GLclampf alpha);
Description:
Specifies the red, green, blue, and alpha values used by glClear to
clear the color buffers
Playing the OpenGL Game..
101
glClearColor()
Specify which matrix is the current matrix.
Usage:
void glMatrixMode(GLenum mode);
Description:
Sets the current matrix mode. mode can assume one of four values:
GL_MODELVIEW
GL_PROJECTION
GL_TEXTURE
GL_COLOR
Playing the OpenGL Game..
102
glClear()
Clear buffers to preset values.
Usage:
void glClear(GLbitfield mask);
Description:
sets the bitplane area of the window to values previously selected
by glClearColor, glClearIndex, glClearDepth, glClearStencil, and
glClearAccum. Multiple color buffers can be cleared simultaneously
by selecting more than one buffer at a time using glDrawBuffer.
Playing the OpenGL Game..
103
glColor3f()
Set the current color.
Usage:
void glColor3f(GLfloat red, GLfloat green, GLfloat blue);
Description:
Current color values are stored in floating-point format, with
unspecified mantissa and exponent sizes.
Playing the OpenGL Game..
104
glPointSize()
Specify the diameter of rasterized points.
Usage:
void glPointSize(GLfloat size);
Description:
Specifies the rasterized diameter of both aliased and antialiased
points.
Playing the OpenGL Game..
105
glFlush()
Force execution of GL commands in finite time.
Usage:
void glFlush( void);
Description:
Empties all of these buffers, causing all issued commands to be
executed as quickly as they are accepted by the actual rendering
engine.
Playing the OpenGL Game..
106
glBegin() and glEnd()
Delimit the vertices of a primitive or a group of like primitives.
Usage:
void glBegin(GLenum mode);
void glEnd( void);
Description:
delimit the vertices that define a primitive or a group of like
primitives.
Simple OpenGL with C++
107
#include <GL/glut.h>
#include <iostream>
#include <conio.h>
void sample()
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0,300,0,300);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,1.0,0.0);
glPointSize(20);
glBegin(GL_POINTS);
glVertex2i(10,20);
glEnd();
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc,argv);
glutInitWindowSize(400,400);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowPosition(0,0);
glutCreateWindow(“Sample Window");
glutDisplayFunc(sample);
glutMainLoop();
return 0;
}
Thank you!!!
108
???
109

More Related Content

PPTX
Raster Scan display
Lokesh Singrol
 
PDF
Lecture 16 KL Transform in Image Processing
VARUN KUMAR
 
PPTX
ANIMATION SEQUENCE
KABILESH RAMAR
 
PPTX
Smoothing in Digital Image Processing
Pallavi Agarwal
 
PPT
Random and raster scan
ankur bhalla
 
PPTX
Input of graphical data
Rajapriya82
 
PPTX
Image Enhancement in Spatial Domain
DEEPASHRI HK
 
PPTX
Fourier descriptors & moments
rajisri2
 
Raster Scan display
Lokesh Singrol
 
Lecture 16 KL Transform in Image Processing
VARUN KUMAR
 
ANIMATION SEQUENCE
KABILESH RAMAR
 
Smoothing in Digital Image Processing
Pallavi Agarwal
 
Random and raster scan
ankur bhalla
 
Input of graphical data
Rajapriya82
 
Image Enhancement in Spatial Domain
DEEPASHRI HK
 
Fourier descriptors & moments
rajisri2
 

What's hot (20)

PPTX
IMAGE SEGMENTATION.
Tawose Olamide Timothy
 
PPTX
Chapter 1
kparthjadhav
 
PPTX
Chapter 6 color image processing
asodariyabhavesh
 
PPTX
Raster scan system & random scan system
shalinikarunakaran1
 
PPTX
Video display devices
shalinikarunakaran1
 
PPTX
Introduction to computer graphics
Priyodarshini Dhar
 
PPTX
3D transformation in computer graphics
SHIVANI SONI
 
PPT
Image segmentation ppt
Gichelle Amon
 
PPTX
Hit and-miss transform
Krish Everglades
 
PPT
Computer graphics
Mohsin Azam
 
PPT
Chapter10 image segmentation
asodariyabhavesh
 
PPTX
Output primitives in Computer Graphics
Kamal Acharya
 
PPTX
Features image processing and Extaction
Ali A Jalil
 
PPTX
1.arithmetic & logical operations
mukesh bhardwaj
 
PPTX
Computer graphics chapter 4
PrathimaBaliga
 
PDF
Lecture 4 Relationship between pixels
VARUN KUMAR
 
PPSX
Image Enhancement in Spatial Domain
Dr. A. B. Shinde
 
PDF
Digital Image Fundamentals
Dr. A. B. Shinde
 
PPT
Image enhancement
Dr INBAMALAR T M
 
IMAGE SEGMENTATION.
Tawose Olamide Timothy
 
Chapter 1
kparthjadhav
 
Chapter 6 color image processing
asodariyabhavesh
 
Raster scan system & random scan system
shalinikarunakaran1
 
Video display devices
shalinikarunakaran1
 
Introduction to computer graphics
Priyodarshini Dhar
 
3D transformation in computer graphics
SHIVANI SONI
 
Image segmentation ppt
Gichelle Amon
 
Hit and-miss transform
Krish Everglades
 
Computer graphics
Mohsin Azam
 
Chapter10 image segmentation
asodariyabhavesh
 
Output primitives in Computer Graphics
Kamal Acharya
 
Features image processing and Extaction
Ali A Jalil
 
1.arithmetic & logical operations
mukesh bhardwaj
 
Computer graphics chapter 4
PrathimaBaliga
 
Lecture 4 Relationship between pixels
VARUN KUMAR
 
Image Enhancement in Spatial Domain
Dr. A. B. Shinde
 
Digital Image Fundamentals
Dr. A. B. Shinde
 
Image enhancement
Dr INBAMALAR T M
 
Ad

Viewers also liked (20)

PPTX
3D Graphics : Computer Graphics Fundamentals
Muhammed Afsal Villan
 
PPTX
Polygon mesh
Farah M. Altufaili
 
PDF
Computer Graphics
Griffinder VinHai
 
PPTX
Viewing transformation
Udayan Gupta
 
PPT
Polygon Notes
acavis
 
PDF
On NURBS Geometry Representation in 3D modelling
Pirouz Nourian
 
PPT
Hidden surfaces
Mohd Arif
 
PPT
3 d projections
Mohd Arif
 
PDF
Notes 2D-Transformation Unit 2 Computer graphics
NANDINI SHARMA
 
PPT
hidden surface elimination using z buffer algorithm
rajivagarwal23dei
 
PDF
CG OpenGL line & area-course 3
fungfung Chen
 
PPTX
2 d viewing computer graphics
KALESHWAR KUMAR
 
PPT
2D viewing
HiteshJain007
 
PPTX
Opengl lec 3
elnaqah
 
PPTX
3 d graphics with opengl part 2
Sardar Alam
 
PPTX
Iccv2009 recognition and learning object categories p1 c03 - 3d object models
zukun
 
DOCX
Computer graphics
amitsarda3
 
PDF
CG OpenGL polar curves & input display color-course 4
fungfung Chen
 
PPT
07object3d
Ketan Jani
 
PDF
CG OpenGL 3D object representations-course 8
fungfung Chen
 
3D Graphics : Computer Graphics Fundamentals
Muhammed Afsal Villan
 
Polygon mesh
Farah M. Altufaili
 
Computer Graphics
Griffinder VinHai
 
Viewing transformation
Udayan Gupta
 
Polygon Notes
acavis
 
On NURBS Geometry Representation in 3D modelling
Pirouz Nourian
 
Hidden surfaces
Mohd Arif
 
3 d projections
Mohd Arif
 
Notes 2D-Transformation Unit 2 Computer graphics
NANDINI SHARMA
 
hidden surface elimination using z buffer algorithm
rajivagarwal23dei
 
CG OpenGL line & area-course 3
fungfung Chen
 
2 d viewing computer graphics
KALESHWAR KUMAR
 
2D viewing
HiteshJain007
 
Opengl lec 3
elnaqah
 
3 d graphics with opengl part 2
Sardar Alam
 
Iccv2009 recognition and learning object categories p1 c03 - 3d object models
zukun
 
Computer graphics
amitsarda3
 
CG OpenGL polar curves & input display color-course 4
fungfung Chen
 
07object3d
Ketan Jani
 
CG OpenGL 3D object representations-course 8
fungfung Chen
 
Ad

Similar to Computer Graphics (20)

PDF
Fundamentals of Computer Graphics.pdf
Mattupallipardhu
 
PPTX
Overview of Computer Graphics
United International University
 
PPT
Unit I-cg.ppt Introduction to Computer Graphics elements
RajeshSukte1
 
PPT
Introduction to Computer Graphics elements
RajeshSukte1
 
PPT
Introduction to Computer Graphics computer
RajeshSukte1
 
PPT
Ciencias de la computación, Gráficos por computadora.
Watchsoft
 
PPTX
Chapter02 graphics-programming
Mohammed Romi
 
PDF
Cg lab cse-v (1) (1)
Surya Sukumaran
 
PPT
Graphics display-devicesmod-1
Praveen Kumar
 
PPT
Computer graphics - Nitish Nagar
Nitish Nagar
 
PDF
Cocos2d 소개 - Korea Linux Forum 2014
Changwon National University
 
PPTX
Introduction to Computer graphics
LOKESH KUMAR
 
PDF
Co315 part 1
Aksh Gupta
 
PPTX
Unit 11. Graphics
Ashim Lamichhane
 
PDF
ENEI16 - WebGL with Three.js
José Ferrão
 
PDF
Cocos2d programming
Changwon National University
 
PDF
Analysis of KinectFusion
Dong-Won Shin
 
PDF
Chapter-3.pdf
mekelle university(EiT-M)
 
PPT
openGL basics for sample program.ppt
HIMANKMISHRA2
 
PPT
openGL basics for sample program (1).ppt
HIMANKMISHRA2
 
Fundamentals of Computer Graphics.pdf
Mattupallipardhu
 
Overview of Computer Graphics
United International University
 
Unit I-cg.ppt Introduction to Computer Graphics elements
RajeshSukte1
 
Introduction to Computer Graphics elements
RajeshSukte1
 
Introduction to Computer Graphics computer
RajeshSukte1
 
Ciencias de la computación, Gráficos por computadora.
Watchsoft
 
Chapter02 graphics-programming
Mohammed Romi
 
Cg lab cse-v (1) (1)
Surya Sukumaran
 
Graphics display-devicesmod-1
Praveen Kumar
 
Computer graphics - Nitish Nagar
Nitish Nagar
 
Cocos2d 소개 - Korea Linux Forum 2014
Changwon National University
 
Introduction to Computer graphics
LOKESH KUMAR
 
Co315 part 1
Aksh Gupta
 
Unit 11. Graphics
Ashim Lamichhane
 
ENEI16 - WebGL with Three.js
José Ferrão
 
Cocos2d programming
Changwon National University
 
Analysis of KinectFusion
Dong-Won Shin
 
openGL basics for sample program.ppt
HIMANKMISHRA2
 
openGL basics for sample program (1).ppt
HIMANKMISHRA2
 

More from Adri Jovin (20)

PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
DOCX
Curriculum Vitae of Adri Jovin John Joseph
Adri Jovin
 
PPTX
Introduction to Relational Database Management Systems
Adri Jovin
 
PPTX
Introduction to ER Diagrams
Adri Jovin
 
PPTX
Introduction to Database Management Systems
Adri Jovin
 
PPTX
Neural Networks
Adri Jovin
 
PPTX
Introduction to Genetic Algorithm
Adri Jovin
 
PPTX
Introduction to Fuzzy logic
Adri Jovin
 
PPTX
Introduction to Artificial Neural Networks
Adri Jovin
 
PPTX
Introductory Session on Soft Computing
Adri Jovin
 
PPTX
Creative Commons
Adri Jovin
 
PPTX
Image based security
Adri Jovin
 
PPTX
Blockchain Technologies
Adri Jovin
 
PPTX
Introduction to Cybersecurity
Adri Jovin
 
PPTX
Advanced Encryption System & Block Cipher Modes of Operations
Adri Jovin
 
PPTX
Heartbleed Bug: A case study
Adri Jovin
 
PPTX
Zoom: Privacy and Security - A case study
Adri Jovin
 
PPTX
Elliptic Curve Cryptography
Adri Jovin
 
PPTX
El Gamal Cryptosystem
Adri Jovin
 
PPTX
Data Encryption Standard
Adri Jovin
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
Curriculum Vitae of Adri Jovin John Joseph
Adri Jovin
 
Introduction to Relational Database Management Systems
Adri Jovin
 
Introduction to ER Diagrams
Adri Jovin
 
Introduction to Database Management Systems
Adri Jovin
 
Neural Networks
Adri Jovin
 
Introduction to Genetic Algorithm
Adri Jovin
 
Introduction to Fuzzy logic
Adri Jovin
 
Introduction to Artificial Neural Networks
Adri Jovin
 
Introductory Session on Soft Computing
Adri Jovin
 
Creative Commons
Adri Jovin
 
Image based security
Adri Jovin
 
Blockchain Technologies
Adri Jovin
 
Introduction to Cybersecurity
Adri Jovin
 
Advanced Encryption System & Block Cipher Modes of Operations
Adri Jovin
 
Heartbleed Bug: A case study
Adri Jovin
 
Zoom: Privacy and Security - A case study
Adri Jovin
 
Elliptic Curve Cryptography
Adri Jovin
 
El Gamal Cryptosystem
Adri Jovin
 
Data Encryption Standard
Adri Jovin
 

Recently uploaded (20)

PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Activate_Methodology_Summary presentatio
annapureddyn
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 

Computer Graphics

  • 1. COMPUTER GRAPHICS Adri Jovin J.J. Assistant Professor Department of Information Technology SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY 1 ONE DAY NATIONAL SEMINAR ON IES COLLEGE OF ENGINEERING
  • 2. OUTLINE 2 Basics of Computer Graphics 3D Concepts Color Profiles & Animation GPU OpenGL
  • 3. Basics of Computer Graphics 3 Computing Classification System CCS Computing Methodologies Computer Graphics Geometry + Principles of Engineering Graphics + Mapping with Display Device
  • 4. What is Computer Graphics 4 • The term computer graphics describes any use of computers to create and manipulate images. • can be two- or three-dimensional • has a wide range of application
  • 28. Points and Lines 28 • setpixel(x,y) – load a specified color point in the location specified by x and y • getpixel(x,y) – retrieve the current frame buffer intensity
  • 29. Line drawing algorithms 29 cxmy  . 12 12 xx yy m    11 xmyc  m y x   xmy 
  • 30. DDA Algorithm 30 • Digital Differential Analyzer • Consider positive slope and the slope is less than or equal to 1. • We sample at unit x interval • For lines with positive slope, greater than 1, the roles of x and y are reversed myy kk 1 m xx kk 1 1 
  • 31. DDA Algorithm (Contd..) 31 • If the process start from right end point, we have • Therefore • Similarly, for slope greater than 1, myy kk 1 1x m xx kk 1 1 
  • 32. Bresenham Line Drawing Algorithm 32
  • 33. 2D Transformation - Translation 33 y x P P
  • 34. 2D Transformation - Translation 34 y x y x TPP 
  • 35. 2D Transformation - Rotation 35 y x  P P PRP .           cossin sincos R
  • 36. 2D Transformation – Uniform Scaling 36                     y x s s y x y x . 0 0 PSP .
  • 37. 2D Transformation – Differential Scaling 37
  • 38. 2D Transformation – Reflection 38 x y Original Position Reflected Position 1 2 3 1’ 2’ 3’            100 010 001
  • 39. 2D Transformation – Shear 39 x y (0,1) (1,1) (1,0)(0,0) x y (1,0)(0,0) (2,1) (3,1)           100 010 01 xsh yshxx x. yy 
  • 40. Composite 2D Transformation 40 (a) Original Position of the Object and Pivot Point (b) Translation of object to take the pivot point to origin (c) Rotation about the origin (d) Translation of object to original pivot point
  • 41. Line Clipping 41 1001 1000 1010 0001 0000 Window 0010 0101 0100 0110
  • 43. Polygon Clipping 43 Original Polygon Clip Left Clip Right Clip Bottom Clip Top
  • 44. 3D Concepts and Object Representations 44
  • 45. 3D Display Methods 45 • Parallel Projection • Perspective Projection • Depth Cueing • Visible Line and Surface Identification
  • 49. Visible Line and Surface Identification 49
  • 50. 3D Graphic Packages 50 Modeling Transformation Viewing and Projection Transformation Workstation Transformation Modeling Coordinates World Coordinates Projection Coordinates Device Coordinates
  • 51. 3D Object Representations 51 • Boundary representations (B-reps) – describe a three-dimensional object as a set of surfaces that separate the object interior from the environment. • Space-partitioning representations – used to describe interior properties, by partitioning the spatial region containing an object into a set of small, non-overlapping, contiguous solids (usually cubes).
  • 52. Polygon Surfaces 52 • most commonly used boundary presentation • set of surface polygons enclose the object interior • Used in most graphics systems • simplifies and speeds up the surface rendering and display of objects
  • 54. Plane Equations 54 • Ax + By + Cz + D = 0, where (x,y,z) is any point on the plane. 33 22 11 1 1 1 zx zx zx B  33 22 11 1 1 1 zy zy zy A  1 1 1 33 22 11 yx yx yx C  333 222 111 zyx zyx zyx D 
  • 56. Quadric Surfaces 56 • Second Degree equations • Sphere • Ellipsoid
  • 60. Blobby Objects 60 • Metaball Model • Soft Object Model
  • 61. Spline Representations 61 • Interpolation Model • Approximation Model
  • 62. Parametric Continuity 62 • Zero-order  Means simply that the curve meets • First – order  The first derivatives of two adjoining curve functions are equal (or) the tangents are shared • Second –order  Both the first order and the second order derivatives of two adjoining curve functions are equal
  • 64. B-Spline Curves and Surfaces 64 • B- Spline Curves
  • 66. NURBS 66 • Non-uniform Rational B-Spline • Use of non-uniform knot-vector representations for constructing rational B- splines
  • 68. RGB Color Model 68 • Based on “tristimulus theory of vision” – eyes perceive color through the stimulation of three visual pigments in the cones of the retina – peak sensitivity at wavelengths of about 630 nm (red), 530 nm (green), and 450 nm (blue) • Represented as a unit cube defined on R, G, B axes • Color Ck = RR + GG + BB
  • 69. RGB Color Model (Contd..) 69 "Cie Chart with sRGB gamut by spigget" by Spigget - Own work. Licensed under Creative Commons Attribution-Share Alike 3.0 via Wikimedia Commons - http://commons.wikimedia.org/wiki/File:Cie_Chart_with_sRGB_gamut_ by_spigget.png#mediaviewer/File:Cie_Chart_with_sRGB_gamut_by_spig get.png
  • 70. YIQ Color Model 70 • National Television System Committee (NTSC) color model for forming the composite video signal
  • 71. YIQ Color Model (Contd…) 71 "YIQ IQ plane" by Tonyle - Own work. Licensed under Creative Commons Attribution-Share Alike 3.0 via Wikimedia Commons - http://commons.wikimedia.org/wiki/File:YIQ_IQ_plane.s vg#mediaviewer/File:YIQ_IQ_plane.svg
  • 72. CMY Color Model 72 • Defined with the primary colors cyan, magenta, and yellow • Useful for describing color output to hard-copy devices
  • 73. CMY Color Model (Contd…) 73
  • 74. HSV Color Model 74 • Color parameters in this model are hue ( H ) , saturation( S ) and value( V ) • 3D representation is derived from RGB Cube.
  • 76. Animation Design Steps 76 • Storyboard Layout • Object Definitions • Keyframe Specification • Generation of in-between frames
  • 77. Storyboard 77 • Storyboard is an outline of the action • Defines the motion sequence as a set of basic events that are to take place
  • 78. Object Definition 78 • Object definition is given for each participant in the action • Basic shapes, such as polygons or splines • Associated movements for each object are specified along with the shape.
  • 79. Keyframe 79 • Keyframe is a detailed drawing of the scene at a certain time in the animation sequence • Each object is positioned according to the time for that frame
  • 80. In-betweens 80 • In-betweens are the intermediate frames between the key frames • Determined by the media to be used to display the animation – Film : 24 fps – Graphics Terminals : 30 to 60 fps
  • 81. Other Tasks 81 • Motion Verification • Editing and Production • Synchronization of Sound Track
  • 82. General Computer Animation 82 • Some steps in the development of an animation sequence are well-suited to computer solution. – Object Manipulation and Rendering – Camera Motions ( Zooming, Tilting etc..) – Generation of In-betweens – Store and Manage Object Database
  • 83. Raster Animations 83 • On raster systems, we can generate real-time animation in limited applications using raster operations. • Simple 2D/ 3D transformations • Color Table Transformation
  • 84. Key-frame Systems 84 • Morphing – Transformation of object shapes from one form to another
  • 88. Graphics Processing Unit (GPU) 88 • Also known as Visual Processing Unit • Designed to rapidly manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display • Used in embedded systems, mobile phones, personal computers, workstations, and game consoles • Popularized by NVIDIA in 1999, who marketed the GeForce 256 as "the world's first GPU"
  • 90. 90
  • 91. OpenGL 91 • Developed by Silicon Graphics in early 90’s • Most widely-used open graphics standard in the world • Supports both 2D and 3D Graphics APIs
  • 92. OpenGL (Contd..) 92 • OpenGL applications use the window system’s window, input, and event mechanism • GLU supports quadrics, NURBS, complex polygons, matrix utilities, and more
  • 93. Playing the OpenGL Game 93 glutInit() Used to initialize the GLUT library Usage: void glutInit(int *argcp, char **argv); Description: Initialize the GLUT library and negotiate a session with the window system.
  • 94. Playing the OpenGL Game.. 94 glutInitWindowSize() Set the initial window size Usage: void glutInitWindowSize(int width, int height); Description: Windows created by glutCreateWindow will be requested to be created with the current initial window size.
  • 95. Playing the OpenGL Game.. 95 glutInitWindowPosition() Set the initial window position Usage: void glutInitWindowPosition(int x, int y); Description: Windows created by glutCreateWindow will be requested to be created with the current initial window position.
  • 96. Playing the OpenGL Game.. 96 glutInitDisplayMode() Set the initial window display mode. Usage: void glutInitDisplayMode(unsigned int mode); mode - Display mode, normally the bitwise OR-ing of GLUT display mode bit masks Description: Used when creating top-level windows, subwindows, and overlays to determine the OpenGL display mode for the to-be-created window or overlay.
  • 97. Playing the OpenGL Game.. 97 glutCreateWindow() Creates a top-level window. Usage: int glutCreateWindow(char *name); Description: Creates a top-level window. The intent is that the window system will label the window with the name.
  • 98. Playing the OpenGL Game.. 98 glutDisplayFunc() Sets the display callback for the current window. Usage: void glutDisplayFunc(void (*func)(void)); Description: Sets the display callback for the current window. When GLUT determines that the normal plane for the window needs to be redisplayed, the display callback for the window is called. Before the callback, the current window is set to the window needing to be redisplayed and (if no overlay display callback is registered) the layer in use is set to the normal plane. The display callback is called with no parameters.
  • 99. Playing the OpenGL Game.. 99 glutMainLoop() Enters the GLUT event processing loop. Usage: void glutMainLoop(void); Description: Enters the GLUT event processing loop. This routine should be called at most once in a GLUT program. Once called, this routine will never return.
  • 100. Playing the OpenGL Game.. 100 glClearColor() Specify clear values for the color buffers. Usage: void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); Description: Specifies the red, green, blue, and alpha values used by glClear to clear the color buffers
  • 101. Playing the OpenGL Game.. 101 glClearColor() Specify which matrix is the current matrix. Usage: void glMatrixMode(GLenum mode); Description: Sets the current matrix mode. mode can assume one of four values: GL_MODELVIEW GL_PROJECTION GL_TEXTURE GL_COLOR
  • 102. Playing the OpenGL Game.. 102 glClear() Clear buffers to preset values. Usage: void glClear(GLbitfield mask); Description: sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using glDrawBuffer.
  • 103. Playing the OpenGL Game.. 103 glColor3f() Set the current color. Usage: void glColor3f(GLfloat red, GLfloat green, GLfloat blue); Description: Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes.
  • 104. Playing the OpenGL Game.. 104 glPointSize() Specify the diameter of rasterized points. Usage: void glPointSize(GLfloat size); Description: Specifies the rasterized diameter of both aliased and antialiased points.
  • 105. Playing the OpenGL Game.. 105 glFlush() Force execution of GL commands in finite time. Usage: void glFlush( void); Description: Empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine.
  • 106. Playing the OpenGL Game.. 106 glBegin() and glEnd() Delimit the vertices of a primitive or a group of like primitives. Usage: void glBegin(GLenum mode); void glEnd( void); Description: delimit the vertices that define a primitive or a group of like primitives.
  • 107. Simple OpenGL with C++ 107 #include <GL/glut.h> #include <iostream> #include <conio.h> void sample() { glClearColor(1.0,1.0,1.0,0.0); glMatrixMode(GL_PROJECTION); gluOrtho2D(0,300,0,300); glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0,1.0,0.0); glPointSize(20); glBegin(GL_POINTS); glVertex2i(10,20); glEnd(); glFlush(); } int main(int argc, char **argv) { glutInit(&argc,argv); glutInitWindowSize(400,400); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); glutInitWindowPosition(0,0); glutCreateWindow(“Sample Window"); glutDisplayFunc(sample); glutMainLoop(); return 0; }