Date post: | 25-Feb-2018 |
Category: |
Documents |
Upload: | zeeshan-bhatti |
View: | 217 times |
Download: | 0 times |
of 51
7/25/2019 Computer Graphics_Chapter 2
1/51
COMPUTER GRAPHICSDRAWING 2D PRIMITIVES
Dr. Zeeshan Bhatti
BSIT-PIV
Chapter 2
Institute of Information and Communication TechnologyUniversity of Sindh, Jamshoro BY: DR. ZEES HAN BHAT TI 1
7/25/2019 Computer Graphics_Chapter 2
2/51
7/25/2019 Computer Graphics_Chapter 2
3/51
INTERACTIVE GRAPHIC SYSTEM
7/25/2019 Computer Graphics_Chapter 2
4/51
INTERACTIVE GRAPHIC SYSTEM
Application Model
Represents data and objects to be displayed on the output
device
Application Program
Creates, stores into, and retrieves from the application model
Handles user-inputs
Sends output commands to the graphics system:
Which geometric object to view (point, line, circle, polygon)
How to view it (color, line-style, thickness, texture)
7/25/2019 Computer Graphics_Chapter 2
5/51
GRAPHICS SYSTEM
Intermediates between the application program and theinterface hardware:
Output flow Input flow
Causes the application program to be deviceindependent.
7/25/2019 Computer Graphics_Chapter 2
6/51
DISPLAY HARDWARE
CRT - CATHODE RAY TUBE
7/25/2019 Computer Graphics_Chapter 2
7/51
RASTER SCAN (CRT)
7/25/2019 Computer Graphics_Chapter 2
8/51
DISPLAY HARDWARE
FED - FIELD EMISSION DISPLAY
7/25/2019 Computer Graphics_Chapter 2
9/51
IMAGE REPRESENTATION IN RASTER
DISPLAYS
7/25/2019 Computer Graphics_Chapter 2
10/51
RASTER DISPLAY
7/25/2019 Computer Graphics_Chapter 2
11/51
TERMINOLOGYPixel: Picture element. Smallest accessible element in picture
Assume rectangular or circular shape
Aspect Ratio: Ratio between physical dimensions of a pixel (not necessarily1)
Dynamic Range: The ratio between the minimal (not zero!) and themaximal light intensity a display pixel can emit
Resolution: The number of distinguishable rows and columns in the device.Measured in: Absolute values (1K x 1K) or,
Density values (300 dpi [=dots per inch])
Screen Space: A discrete Cartesian coordinate system of the screen pixels
Object Space: The Cartesian coordinate system of the universe, in which theobjects (to be displayed) are embedded
7/25/2019 Computer Graphics_Chapter 2
12/51
SCAN CONVERSION
The conversion from a geometrical representation of anobject to pixels in a raster display . OR
The process of representing continuous graphical objects
as a collection of discrete pixels by identifying theirlocations and setting them ON is calledscan conversion.
7/25/2019 Computer Graphics_Chapter 2
13/51
REPRESENTATIONS
7/25/2019 Computer Graphics_Chapter 2
14/51
LINE IN 2 DIMENSIONS
7/25/2019 Computer Graphics_Chapter 2
15/51
SCAN CONVERSION
Generally Four types:
1. Polynomial method
2. DDA (Digital Difference Analyzer) method
3. Bresenhams method
4. Midpoint method
7/25/2019 Computer Graphics_Chapter 2
16/51
SCAN CONVERSION
Most of the standard type of graphical pbjects like lines, circles, etc.,are defined by a mathematical function.
For example, a straight line segment is defined by the followingequation:
Where m is the slope of the line and b is the y-intercept on thepositive Y-axis.
Similar are the cases with circles, ellipses, parabolas, etc.
7/25/2019 Computer Graphics_Chapter 2
17/51
SCAN CONVERSION
POLYNOMIAL METHOD FOR LINES
7/25/2019 Computer Graphics_Chapter 2
18/51
SCAN CONVERSION - LINES
Incremental Algorithm
7/25/2019 Computer Graphics_Chapter 2
19/51
SCAN CONVERSION - LINES
7/25/2019 Computer Graphics_Chapter 2
20/51
PSEUDO CODE FOR BASIC LINE
DRAWINGAssume x1>x0 and line slope absolute value is 1
7/25/2019 Computer Graphics_Chapter 2
21/51
BASIC LINE DRAWING
7/25/2019 Computer Graphics_Chapter 2
22/51
MIDPOINT (BRESENHAM) LINE
DRAWING
7/25/2019 Computer Graphics_Chapter 2
23/51
MIDPOINT (BRESENHAM) LINE
DRAWING
7/25/2019 Computer Graphics_Chapter 2
24/51
MIDPOINT (BRESENHAM) LINE
DRAWING
7/25/2019 Computer Graphics_Chapter 2
25/51
MIDPOINT (BRESENHAM) LINE
DRAWING
7/25/2019 Computer Graphics_Chapter 2
26/51
MIDPOINT (BRESENHAM) LINE
DRAWING
7/25/2019 Computer Graphics_Chapter 2
27/51
PSEUDO CODE FOR MIDPOINT LINE
DRAWING
7/25/2019 Computer Graphics_Chapter 2
28/51
SCAN CONVERSION - CIRCLES
7/25/2019 Computer Graphics_Chapter 2
29/51
SCAN CONVERSION - CIRCLES
7/25/2019 Computer Graphics_Chapter 2
30/51
SCAN CONVERSION - CIRCLES
7/25/2019 Computer Graphics_Chapter 2
31/51
SCAN CONVERSION - CIRCLES
7/25/2019 Computer Graphics_Chapter 2
32/51
CIRCLE MIDPOINT (FOR ONE OCTANT)
7/25/2019 Computer Graphics_Chapter 2
33/51
CIRCLE MIDPOINT (FOR ONE OCTANT)
Threshold Criteria:
7/25/2019 Computer Graphics_Chapter 2
34/51
CIRCLE MIDPOINT (FOR ONE OCTANT)
7/25/2019 Computer Graphics_Chapter 2
35/51
PSEUDO CODE FOR CIRCLE MIDPOINT
7/25/2019 Computer Graphics_Chapter 2
36/51
PSEUDO CODE FOR CIRCLE MIDPOINT
7/25/2019 Computer Graphics_Chapter 2
37/51
PSEUDO CODE FOR CIRCLE MIDPOINT
7/25/2019 Computer Graphics_Chapter 2
38/51
CIRCLE MIDPOINT
7/25/2019 Computer Graphics_Chapter 2
39/51
POLYGON FILL
7/25/2019 Computer Graphics_Chapter 2
40/51
SCAN CONVERSION - POLYGON FILL
7/25/2019 Computer Graphics_Chapter 2
41/51
FLOOD FILL ALGORITHM
7/25/2019 Computer Graphics_Chapter 2
42/51
FLOOD FILL ALGORITHM
7/25/2019 Computer Graphics_Chapter 2
43/51
FILL POLYGON
7/25/2019 Computer Graphics_Chapter 2
44/51
SCAN CONVERSION BASIC
ALGORITHM
7/25/2019 Computer Graphics_Chapter 2
45/51
SCAN CONVERSION FILL
POLYGON
7/25/2019 Computer Graphics_Chapter 2
46/51
SCAN CONVERSION FILL
POLYGON
7/25/2019 Computer Graphics_Chapter 2
47/51
FILL POLYGON OPTIMIZED
ALGORITHM
7/25/2019 Computer Graphics_Chapter 2
48/51
FILL POLYGON OPTIMIZED
ALGORITHM
7/25/2019 Computer Graphics_Chapter 2
49/51
FLOOD FILL VS. SCAN CONVERSION
7/25/2019 Computer Graphics_Chapter 2
50/51
7/25/2019 Computer Graphics_Chapter 2
51/51
THANKYOU
Q & AReferred Book
Computer Graphics: Principles and Practice in C,by J. D. Foley, A. Van Dam, S. K. Feiner, J. F. Hughes.Hardcover, 1200 pages, Addison-Wesley Pub Co; 2nd edition,
For Course Slides and Handouts
web page:https://sites.google.com/site/drzeeshanacademy/
Blog:http://zeeshanacademy.blogspot.com/
Facebook:
https://www.facebook.com/drzeeshanacademy
https://sites.google.com/site/drzeeshanacademy/http://zeeshanacademy.blogspot.com/http://zeeshanacademy.blogspot.com/https://sites.google.com/site/drzeeshanacademy/