Module 2 CG
Module 2 CG
Output Primitives
Output Primitives are basic geometric shapes or structures.
For example, Point, Straight Line, Sector, Arc, Ellipse, Rectangle, etc.
In computer graphics, output primitives are the basic elements or
building blocks used to create more complex graphical objects.
Graphical programming packages/software tools provide functions to
combine and manipulate these Output Primitives to build/create
complex graphics scenes or images.
Scan Conversion
Scan Conversion is the process of representing continuous graphics
objects (like lines, circles, or polygons) as a collection of discrete pixels
that can be displayed on output display devices.
The video display devices work by converting the binary values (0 and 1)
into pixel information. When the pixel information is 0 then the pixel is
off and when the pixel information is 1 then the pixel is one.
Using this ability, graphics computers can create images made up of tiny
dots called pixels.
Any model of graphics can be generated by controlling the matrix of dots
or points. For generating graphical objects, many algorithms have been
developed.
The algorithms implementation varies from one computer system to
another computer system. Some algorithms are implemented using the
software. Some are performed using hardware or firmware. Some are
performed using various combinations of hardware, firmware, and
software.
Advantage of developing algorithms for scan conversion
Algorithms can generate graphics objects at a faster rate.
Using algorithms memory can be used efficiently.
Algorithms can develop a higher level of graphical objects.
Examples of objects, which can be scan converted are:
Point
Line
Sector
Arc
Ellipse
Rectangle
Polygon
Characters
Filled Regions
Scan Conversion of Line
DDA Algorithms use multiplication & division Bresenham's Line Algorithm uses only
operations subtraction and addition operations
DDA Algorithm is slowly than Bresenham's Line Bresenham's Algorithm is faster than DDA
Algorithmin line drawing because it uses real arithmetic Algorithm in line because it involves only
(Floating Point operation) addition & subtraction in its calculation and
uses only integer arithmetic.
DDA Algorithm is not accurate and efficient as Bresenham's Line Algorithm is more accurate
compared to Bresenham's Line Algorithm. and efficient than DDA Algorithm.
DDA Algorithm can draw circles and curves. But they Bresenham's Line Algorithm can draw circles
cannot draw it accurately as compared to Bresenham's and curves more accurately than DDA
Line Algorithm. Algorithm.
X
List of intersection points:
8, 12, 16, 20
The Sorted order will be:
8, 12, 16, 20
Make pairs of the intersection:
(8, 12) and (16, 20)
Fill in all the pixels with the color inside the pixel.