2. ❑ Graphics are defined as any sketch or a drawing or a special
network that pictorially represents some meaningful information.
❑ Computer Graphics is used where a set of images needs to be manipulated
or the creation of the image in the form of pixels and is drawn on the
computer.
❑ Computer Graphics can be used in digital photography, film,
entertainment, electronic gadgets, and all other core technologies which are
required. It is a vast subject and area in the field of computer science.
❑ Computer Graphics can be used in UI design, rendering, geometric objects,
animation, and many more.
❑ In most areas, computer graphics is an abbreviation of CG.
INTRODUCTION TO COMPUTERGRAPHICS
3. POINTS :
❑ A Point in three-dimensional geometry is defined as a location in 3D
space that is uniquely defined by an ordered triplet (x, y, z) where x,
y, & z are the distances of the point from the X-axis, Y-axis, and
Z-axis respectively.
POINTS AND LINES
4. ❑ A Line in three-dimensional geometry is defined as a set of points
in 3D that extends infinitely in both directions and is represented
by L : (x – x1) / l = (y – y1) / m = (z – z1) / n; here (x, y, z) are
the position coordinates of any variable point lying on the line,
(x1, y1, z1) are the position coordinates of a point P lying on the
line, and l, m, & n are the direction ratios (DRs).
❑ In 3D a line is also formed by the intersection of two non-parallel
planes.
LINES :
5. LINE-DRAWING ALGORITHMS
❑ “The Line drawing algorithm is a graphical algorithm which is
used to represent the line segment on discrete graphical media,
i.e., printer and pixel-based media.”
❑ A line contains two points. The point is an important element of a
line.
Algorithms of Line Drawing
There are following algorithms used for drawing a line:
□ DDA (Digital Differential Analyzer) Line Drawing
Algorithm
□ Bresenham’s Line Drawing Algorithm
□ Mid-Point Line Drawing Algorithm
6. DDA ALGORITHM
❑ DDA stands ly
zer
.It is an incremental method of scan conversion of
line. In this method calculation is performed at each step but by
using results of previous steps.
❑ Suppose at step i, the pixels is (xi,yi)
The line of equation for step i
yi=mxi+b......................equation 1
Next value will be
yi+1=mxi+1+b.................equation 2
m =
yi+1-yi=∆y.......................equation 3
yi+1-xi=∆x......................equation 4
yi+1=yi+∆y
∆y=m∆x
yi+1=yi+m∆x
∆x=∆y/m
xi+1=xi+∆x
xi+1=xi+∆y/m
7. □ This algorithm is used for scan converting a line. It was developed by
Bresenham.
□ It is an efficient method because it involves only integer addition,
subtractions, and multiplication operations.
□ These operations can be performed very rapidly so lines can be
generated quickly.
BRESENHAM’S LINE ALGORITHM
8. PARALLEL LINE ALGORITHMS
❑ A parallel algorithm is an algorithm that can execute several
instructions simultaneously on different processing devices
and then combine all the individual outputs to produce the
final result.
9. LOADING THE FRAME BUFFER
□ A frame buffer is a large, contiguous piece of computer memory. At
a minimum there is one memory bit for each pixel in the rater; this
amount of memory is called a bit plane. The picture is built up in
the frame buffer one bit at a time.
□ You know that a memory bit has only two states, therefore a single
bit plane yields a black-and white display.
□ You know that a frame buffer is a digital device and the CRT is an
analog device.
□ Therefore, a conversion from a digital representation to an analog
signal must take place is read from the frame buffer and
displayed on the raster when information CRT graphics device.
□ For this you can use a digital to analog converter (DAC).
□ Each pixel in the frame buffer must be accessed and converted
before it is visible on the raster CRT.