Computer Graphics - Chapter 2
Computer Graphics - Chapter 2
DRAWING 2D PRIMITIVES
Institute of Information and Communication Technology
University of Sindh, Jamshoro
BSIT-PIV
Chapter 2
BY: DR. ZEESHAN BHATTI
CHAPTER CONTENTS
Interactive Graphic Systems
Drawing lines
Drawing circles
Filling polygons
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)
GRAPHICS SYSTEM
Intermediates between the application program and the
interface hardware:
Output flow
Input flow
DISPLAY HARDWARE
CRT - CATHODE RAY TUBE
DISPLAY HARDWARE
FED - FIELD EMISSION DISPLAY
RASTER DISPLAY
TERMINOLOGY
Pixel: Picture element.
Smallest accessible element in picture
Assume rectangular or circular shape
SCAN CONVERSION
The conversion from a geometrical representation of an
object to pixels in a raster display . OR
The process of representing continuous graphical objects
as a collection of discrete pixels by identifying their
locations and setting them ON is called scan conversion.
REPRESENTATIONS
LINE IN 2 DIMENSIONS
SCAN CONVERSION
Generally Four types:
1.
Polynomial method
2.
3.
Bresenhams method
4.
Midpoint method
SCAN CONVERSION
Most of the standard type of graphical pbjects like lines, circles, etc.,
are defined by a mathematical function.
SCAN CONVERSION
POLYNOMIAL METHOD FOR LINES
CIRCLE MIDPOINT
POLYGON FILL
FILL POLYGON
THANKYOU
Q&A
Referred 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,
https://sites.google.com/site/drzeeshanacademy/
Blog:
http://zeeshanacademy.blogspot.com/
Facebook:
https://www.facebook.com/drzeeshanacademy
52