Computer Graphics Final-1
Computer Graphics Final-1
a) i)
= 7.28 units
a) ii) find the radius of a circle given that the center is at (2,-3) and the points (-1,-2) lies on the
circle the distance between center and the points lies on the circle will equal to radius of the
= (1) 2 +(-5)2
P
No. 3b)
both sides
100 = 36 + (-1-y)2
-1-y = -+ 8
-y = 1 -+8
-y = -7
Divide by -1 both sides
Y=7
No 3c)
By using a box
PA = y2-y1
No.
Solution
Coordinates of the points A,B and C are given as ( 0,0,0) , (0,b,0) , (0,0,t) and (0,0,0)
Hence PA = PB=PC=PO
P
2
+y
x2 + y2 + z2 = (a-x)2 + y2 +z x2 = (a-x)2 x= a/2 similarly applying the distance formula for PO =
PB and PO=PC we get y=b/2 and z=c/2 therefore coordinates of the points which are equivalent
No 3d)
M = (xm,ym)
M = (x1+x2)/2 , (y1+y2)/2
M = -1/2 , -4/2
M = (-1/2 , -7)
Midpoints solution
M = (Xm, Ym)
M=(x1+x2/2, y1+y2/2)
M= ((-1+1)/2 ,(1+-3)/2)
M= (0/2 , -2/2)
M = (0,1)
No. 3e)
Scaling is the changing of the size of something forexample a toy car to a scale model of a life size
car.
Uniform scaling
This is a type where everything that is scaled is scaled by the same amount.
Forexample
If length of the scaled model is half the length of the real world objects the width of the scaled model
will also be half the width of the real world objects.
In this type the scaling factor doesn’t remain the same, can change when going from one dimension
to another your dimensions are you different measurements forexample your length, your width
and your height. Every dimensional object has three basic measurements.
Question 6
a) What is a graphics display? Discuss the parts of Display Processor. Use a diagram to illustrate the
parts.
b) What is a CRT? What are the parts of a CRT? Use a diagram to illustrate the parts of a CRT.
c) Differentiate between Random Scan and Raster Scan Display. What are the pros and cons of a
random scan display? Illustrate a raster scan display. Discuss the two types of Scanning or
travelling of beam in Raster Scan. Discuss the pros and cons of raster scan display
c) Discuss the two popular approaches for producing colour displays with a CRT. Provide a detailed
description on the following:
d) What are input devices? Discuss the various key input devices. Explain the layout of a keyboard.
Discuss: (i) flatbed scanner, (ii) handheld scanner. Explain how printers can be classified. Use an
illustration to support your answer.
e) Explain the following: interpolation, jaggies, layer, palletized texture, refresh rate, rendering,
texture antialiasing, texture filt
a)
Graphics display is the way in which line drawings and text are displayed. The display device is
an output device used to represent the information in the form of images or in visual form the
Display systems are mostly called a video monitor or Video display unit (VDU).
Discuss the parts of Display Processor. Use a diagram to illustrate the parts.
Display processor is a part of hardware or interpreter which is used to transform display
processor code into pictures. It is used to convert digital information from CPU to analog data.It
is a digital-analog conversion which depends on the types of devices and graphics functions. The
main function of display processors is called scan conversion.
The display processor is also sometimes called a display processing unit (DPU). Parts
of Display Processor have the following four parts:
Display Generator
Display Console
Display Controller
Display File Memory
b)
A cathode-ray tube (CRT) is a specialized vacuum tube in which images are produced when an
electron beam strikes a phosphorescent surface. Most desktop computer displays make use of
CRTs. The CRT in a computer display is similar to the "picture tube" in a television receiver.
Parts of a CRT
Components of CRT
Electron Gun
Electron gun consisting of a series of elements, primarily a heating filament (heater) and a
cathode. The electron gun creates a source of electrons which are focused into a narrow beam
directed at the face of the CRT.
Control Electrode
It is used to turn the electron beam on and off.
Focusing system
It is used to create a clear picture by focusing the electrons into a narrow beam.
Deflection Yoke
It is used to control the direction of the electron beam. It creates an electric or magnetic field
which will bend the electron beam as it passes through the area. In a conventional CRT, the yoke
is linked to a sweep or scan generator. The deflection yoke which is connected to the sweep
generator creates a fluctuating electric or magnetic potential. Phosphorus-coated screen
The inside front surface of every CRT is coated with phosphors. Phosphors glow when a
highenergy electron beam hits them. Phosphorescence is the term used to characterize the light
given off by a phosphor after it has been exposed to an electron beam.
Use a diagram to illustrate the parts of a CRT.
CRT stands for Cathode Ray Tube. CRT is a technology used in traditional computer monitors
and televisions. The image on CRT display is created by firing electrons from the back of the tube
of phosphorus located towards the front of the screen.
Once the electron heats the phosphorus, they light up, and they are projected on a screen. The
colour you view on the screen is produced by a blend of red, blue and green light.
C)
Differentiate between Random Scan and Raster Scan Display.
Random Scan System uses an electron beam which operates like a pencil to create a line image on
the CRT screen. While A Raster Scan Display is based on intensity control of pixels in the form
of a rectangular box called Raster on the screen.
Random Scan Raster Scan
It is restricted to line drawing applications It is suitable for realistic display
It is more expensive It is less expensive
Any modification if needed is easy Modification is tough
Solid pattern is tough to fill Solid pattern is easy to fill
Refresh rate depends or resolution Refresh rate does not depend on the picture.
Only screen with view on an area is displayed. Whole screen is scanned.
Beam Penetration technology come under it. Shadow mark technology came under this.
It does not use interlacing method. It uses interlacing
It has high Resolution Its resolution is low.
Disadvantages
Data about the intensities of all pixels has to be stored.
Resolution is lower than random scan display.
More memory is required.
Advantages
Colour range available is bigger than random scan display.
Real life images with different shades can be displayed.
C)
Discuss the two popular approaches for producing colour displays with a CRT.
The CRT Monitor display by using a combination of phosphors. The phosphors are different
colours. There are two popular approaches for producing colour displays with a CRT are:
i) Beam Penetration Method ii)
Shadow-Mask Method
Beam Penetration Method
The Beam-Penetration method has been used with random-scan monitors. In this method, the
CRT screen is coated with two layers of phosphor, red and green and the displayed colour
depends on how far the electron beam penetrates the phosphor layers. This method produces four
colours only, red, green, orange and yellow. A beam of slow electrons excites the outer red layer
only; hence screen shows red colours only. A beam of high-speed electrons excites the inner
green layer. Thus screen shows a green colour
Shadow-Mask Method
Shadow Mask Method is commonly used in Raster-Scan System because they produce a much
wider range of colours than the beam-penetration method.
It is used in the majority of colours TV sets and monitors.
Construction
A shadow mask CRT has 3 phosphor colours dots at each pixel position. One
phosphor dot emits red light
Another emit green light
Third emit blue light
This type of CRT has 3 electron guns, one for each colours dot and a shadow mask grid just
behind the phosphor coated screen.
Light Pen
Light Pen (similar to the pen) is a pointing device which is used to select a displayed menu item
or draw pictures on the monitor screen. It consists of a photocell and an optical system placed in
a small tube. When its tip is moved over the monitor screen, and pen button is pressed, its
photocell sensing element detects the screen location and sends the corresponding signals to the
CPU.
Discuss
a) flatbed scanner,
Flat Bed Scanner: It resembles a photocopy machine. It has a glass top on its top. Glass top in
further covered using a lid. The document to be scanned is kept on glass plate. The light is passed
underneath side of glass plate. The light is moved left to right. The scanning is done the line by
line. The process is repeated until the complete line is scanned. Within 20-25 seconds a
document of 4" * 6" can be scanned.
b) Hand Held Scanner
It has a number of LED's (Light Emitting Diodes) the LED's are arranged in the small case. It
is called a Hand held Scanner because it can be kept in hand which performs scanning. For
scanning the scanner is moved over document from the top towards the bottom. Its light is
on, while we move it on document. It is dragged very slowly over document. If dragging of
the scanner over the document is not proper, the conversion will not correct.
Explain how printers can be classified. Use an illustration to support your answer. Printers
are classified as
Impact printer
Non-Impact printer
Classification of printers is shown in the image below:
Impact Printer
Impact printer strikes a head or a needle against an ink ribbon to make a mark on the paper.
Impact printer may be three types:
(a) Daisy Wheel Printer,
(b) Drum Printer, and (c)
Dot Matrix Printer.
Its reliability is higher than that of dot matrix printer. It can have speed upto 90 cps.
The time required to rotating the print wheel for each character desired, that’s a reason it is slow
in use. So these printers are slower and expensive than dot matrix printers.
Drum Printers
It is print a single line at a time.
Its printing speed varies from 150 lines to 2500 lines in a minute with 96 to 106 characters on a
15 inch line.
Line printers are designed for heavy printing applications. These printers are faster than character
type printers.
These types of printers produce lot of noise.
Non-Impact Printer
Non-impact printers does not use striking device to produce characters on the paper. These types
of printers spray ink on papers through nozzles to form characters and patterns.
Non-Impact printer may be of two types:
(a) Daisy Wheel Printer, and
(b) Drum Printer Inkjet Printers
Inkjet printers are generally used for home purposes. It is a printer that place extremely small
droplets of ink onto paper to create an image.
Its cost is relatively higher than dot matrix printers but the quality is better.
These kinds of printers produce high quality prints and graphics due to its high-resolution
feature.
Laser Printers
Laser printer produces high quality text and images for personal computers.
Laser printer is also known as page printer because they process and store the entire page before
printing it.
They don’t produce noise and print faster. Thus they are also preferred to print large amount of
contents on large volume of papers.
e)
Explain the following
Interpolation
Is a method of constructing new data points within range of discrete set of known data points the
number of data points obtained by sampling or experimentation represents values of function for
limited number of values of independent variable. Jaggies
Jaggies is the slang term for the blurry jagged lines that can appear in computer graphics. They
typically occur in raster, also known as bitmap, images with decreased resolution. The lines
resemble stairsteps and appear in place of straight lines or curves at the edges of the image Layer
In graphics software, layers are the different levels at which one can place an object or image
file. In the program, layers can be stacked, merged, or defined when creating a digital image.
Palletized texture
In computer graphics, a palette, also called colours lookup table (CLUT), is a correspondence
table in which selected colours from a certain colours space's colours reproduction range are
assigned an index, by which they can be referenced. By referencing the colours via an index,
which takes less information than the one needed to describe the actual colour in said colours
space, this technique aims to reduce data usage, be it as processing payload, transfer bandwidth,
RAM usage or persistent storage. Images in which colours are indicated by references to a CLUT
are called indexed colours image refresh rate, the refresh rate of your display refers to how many
times per second the display is able to draw a new image. This is measured in Hertz (Hz). For
example, if your display has a refresh rate of 144Hz, it is refreshing the image 144 times per
second.
Rendering
Rendering or image synthesis is the process of generating a photorealistic or non-photorealistic
image from a 2D or 3D model by means of a computer program. The resulting image is
referred to as the render. Texture antialiasing
In digital signal processing, anti-aliasing is the technique of minimizing aliasing (jagged or
blocky patterns) when representing a high-resolution signal at a lower resolution. In most cases,
anti-aliasing means removing data at too high a frequency to represent. Texture filtering
Texture filtering is a technique in the field of computer graphics where engineers utilize pixel
maps to fill in a particular graphic area. It commonly uses something called “Texel’s” –
individual picture pixels in a larger texture map.
QUESTION FOUR
MATRICES
Introduction
Matrix
The rows and columns of a matrix determines the dimension of a matrix. A matrix
containing 2 rows and 3 columns is of dimension 2x3. Here is an example of
matrices with different dimensions:
Dimensions in matrix arithmetic is very important, since some operations are not
possible unless matrices have identical dimensions. Matrices can be added and
subtracted. They can be multiplied by a scalar and multiplied among themselves.
Matrices can not be divided, instead a matrix called the Inverse is calculated
which serves as the reciprocal of the matrix. Matrices have an arrangement
property. They can be arranged in row-major format or column-major format.
This is very important to keep in mind since multiplying vectors or matrices of
wrong format will result in wrong calculations. OpenGL requires all matrices to be
in column-major format
Identity Matrix
The Identity Matrix is a special kind of matrix which is similar to the concept of “1” in
real numbers. Just like a real number multiplied by “1” results in the real number
itself, any matrix multiply by the identity matrix results in the matrix itself. The
Identity matrix is defined as:
Multiplying any matrix by the identity matrix results in the same matrix.
TYPES OF MATRICES.
Types of Matrices
Different types of Matrices and their forms are used for solving numerous problems.
Some of them are as follows:
1) Row Matrix
A row matrix has only one row but any number of columns. A matrix is said to be a row
matrix if it has only one row. For example,
2) Column Matrix
A column matrix has only one column but any number of rows. A matrix is said to be a
column matrix if it has only one column. For example,
3) Square Matrix
A square matrix has the number of columns equal to the number of rows. A matrix in
which the number of rows is equal to the number of columns is said to be a square
matrix. Thus an m × n matrix is said to be a square matrix if m = n and is known as a
square matrix of order ‘n’. For example,
4) Rectangular Matrix
A matrix is said to be a rectangular matrix if the number of rows is not equal to the
number of columns. For example,
5) Diagonal matrix
6) Scalar Matrix
A diagonal matrix is said to be a scalar matrix if all the elements in its principal
diagonal are equal to some non-zero constant. A diagonal matrix is said to be a
scalar matrix if its diagonal elements are equal, that is, a square matrix B = [b ij]n × n is
said to be a scalar matrix if
A matrix is said to be zero matrix or null matrix if all its elements are zero.
If a square matrix has all elements 0 and each diagonal elements are non-zero, it is
called identity matrix and denoted by I.
Equal Matrices: Two matrices are said to be equal if they are of the same order and if
their corresponding elements are equal to the square matrix A = [a ij]n × n is an identity
matrix if
• aij = 1 if i = j
• aij = 0 if i ≠ j
We denote the identity matrix of order n by In. When the order is clear from the context,
we simply write it as I. For example,
A square matrix in which all the elements below the diagonal are zero is known as the
upper triangular matrix. For example,
A square matrix in which all the elements above the diagonal are zero is known as the
upper triangular matrix. For example,
Unlike matrix addition, matrix multiplication does not require matrices to be of the
same dimensions. However, the number of rows in matrix M must be equal to the
number of colums in matrix N. For example:
For example:
Note, an
Scalar Multiplication
For example:
Addition/Subtraction
Matrix transposition
Transpose of a matrix
Transpose
1. Reflect A over its main diagonal (which runs from top-left to bottom-right) to
obtain AT
2. Write the rows of A as the columns of AT
3. Write the columns of A as the rows of AT
Formally, the i-th row, j-th column element of AT is the j-th row, i-th column element of
A:
A square matrix whose transpose is equal to itself is called a symmetric matrix; that
is, A is symmetric if
A square complex matrix whose transpose is equal to the matrix with every
entry replaced by its complex conjugate (denoted here with an overline) is
called a Hermitian matrix (equivalent to the matrix being equal to its
conjugate transpose); that is, A is Hermitian if
A square complex matrix whose transpose is equal to the negation of its complex
conjugate is called a skew-Hermitian matrix; that is, A is skew-Hermitian if
A square matrix whose transpose is equal to its inverse is called an orthogonal matrix;
that is, A is orthogonal if
A square complex matrix whose transpose is equal to its conjugate inverse is called a
unitary matrix; that is, A is unitary if
Properties
5. The transpose of a scalar is the same scalar. Together with (2), this states that
the transpose is a linear map from the space of m × n matrices to the space of all
n × m matrices.
6. The determinant of a square matrix is the same as the determinant of its
transpose.
7. The dot product of two column vectors a and b can be computed as the single
entry of the matrix product: which is written as ai bi in Einstein summation
convention.
8. If A has only real entries, then ATA is a positive-semidefinite matrix.
9. The transpose of an invertible matrix is also invertible, and its inverse is the
transpose of the inverse of the original matrix. The notation A−T is sometimes
used to represent either of these equivalent expressions.
10. If A is a square matrix, then its eigenvalues are equal to the eigenvalues of its
transpose, since they share the same characteristic polynomial. Products
If A is an m × n matrix and AT is its transpose, then the result of matrix multiplication
with these two matrices gives two square matrices: A
AT is m × m and AT A is n × n. Furthermore, these products are symmetric matrices.
Indeed, the matrix product A AT has entries that are the inner product of a row of A with
a column of AT. But the columns of AT are the rows of A, so the entry corresponds to
the inner product of two rows of A. If pi j is the entry of the product, it is obtained from
rows i and j in A. The entry pj i is also obtained from these rows, thus pi j = pj i, and the
product matrix (pi j) is symmetric. Similarly, the product AT A is a symmetric matrix. A
quick proof of the symmetry of A AT results from the fact that it is its own transpose:
Illustrat
ion of row- and column-major order
On a computer, one can often avoid explicitly transposing a
matrix in memory by simply accessing the same data in a
different order. For example, software libraries for linear
algebra, such as BLAS, typically provide options to specify
that certain matrices are to be interpreted in transposed
order to avoid the necessity of data movement.
However, there remain a number of circumstances in
which it is necessary or desirable to physically reorder a
matrix in memory to its transposed ordering. For example,
with a matrix stored in row-major order, the rows of the
matrix are contiguous in memory and the columns are
discontiguous. If repeated operations need to be
performed on the columns, for example in a fast Fourier
transform algorithm, transposing the matrix in memory (to
make the columns contiguous) may improve performance
by increasing memory locality.
Ideally, one might hope to transpose a matrix with minimal
additional storage. This leads to the problem of
transposing an n × m matrix in-place, with O(1) additional
storage or at most storage much less than mn. For n ≠ m,
this involves a complicated permutation of the data
elements that is non-trivial to implement in-place.
Therefore, efficient in-place matrix transposition has been
the subject of numerous research publications in computer
science, starting in the late 1950s, and several algorithms
have been developed.
INVERSE OF A MATRIX
The inverse of a matrix is a matrix that multiplied by the original matrix results in the
identity matrix, regardless of the order of the matrix multiplication.
Thus, let A be a square matrix, the inverse of matrix A is denoted by A -1 and satisfies: A·A-
=I
1
A-1·A=I Where
I is the identity matrix.
As you can see, inverting a 2×2 dimension matrix is simple: you only have to solve the
determinant of the matrix (|A|), switch the elements on the main diagonal, and change
the sign of the elements on the secondary diagonal.
Inverse