Home Software Engineering Database Management System Optimization Techniques Maths III Contact/Feedback

Index

  • UNIT - I
    • Advantages of Computer Graphics
    • GUI
    • Conceptual Framework for Interactive Graphics
  • UNIT - II
    • Scan Converting Lines
    • Scan Converting Circles
    • Scan Converting Eclipse
    • Scan Conversion of Line
    • Polygon Clipping
  • UNIT - III
    • Transformation
      • Translation
      • Reflection
      • Scaling
      • Rotation
      • Shearing

UNIT - I

Computer Graphics

Computer Graphics is an art/presentation on visual/relevant display unit of images,pictures , animations with the help of computer program.

(a) Computer Graphics refers to the creation, storage and manipulation.

(b) Such as images, education, entertainment, videos, etc. Every image or picture is in fact a graph with different mathematical tricks are used to manipulate some changes in its properties like shape, size, etc.

(c) Computer Graphics is an art of drawing, pictures, lines, charts, etc.

(d) In computer graphics can be created as 2 or 3 dimensional images.

Some Jargons

Pixel: Pixel is a small unit of a picture displayed on a computer screen

Multimedia means that computer information can be represented as the videos, animation, drawing, images.

gd : graphic driver
pixel : Picture Element ( It is the smallest unit of display )
PPI : Pixel per inch
Vector : Mathematical Formula
Raster : Pixel

First Program of CG

There are two types of Computer Graphics

  1. Interactive CG (Ex: Computer Games)
  2. Non Interactive CG &40Ex: Movies)

Interactive CG: Interactive Computer Graphics that user can control the output with the help of input devices. ( 2 Ways )

Non-Interactive CG: Non Interactive CG that user cannot control the output with the help of input devices ( 1 Way Communication )

Advantages of interactive Computer Graphics-

  1. Representative uses
  2. Designing
  3. Presentation
  4. Simulation
  5. Entertainment
  6. Education
  7. Healthcare
  8. GUI
GUI

Most applications that run or present computer and work station and even those that run on terminals attached to time shared computers and network computer server have users interface they rely on desktop windows system to manage multiple simultaneous activities and on point and click facilities to allow users to select menu items, icons at objects on the screen typing is necessary only to input text to be stored and manipulated.

Example: Word processing, spreadsheet ( Excel ) and desktop publishing ( DTP )

Interactive Plotting

Used in business science technology!

Detailing

The next most common use of graphics is to create 2D and 3D graphics or mathematical, physical, economic functions, bar and pie chart, inventory and production chart, all these are used to present meaningful and concised data. The trends and patterns from the data so as to clarify complex phenomena and to facilitate and inform decision making.

CG

Most computer graphics can also be drawn but the computer can accomplish much more in a much short time. One of of the major benefits of computer graphics is that images can be manipulated relatively easy and that a multitude of visual effects are possible because the images can be played over and over again until the desired effect is achieved.

Conceptual Framework for Interactive Graphics

It is a foundational structure of a set of principle that guides you to design, a creation and utilization of interactive graphics.Framework is a layered structure what kind of program should be build.

CF CF2

Representative Usage of CG

  1. User Interface
  2. Process Central
  3. Interactive plotting in business science & technology
  4. Art & Commerce

Classification of Application Development of Hardware and Software for Computer Graphics

Software: There are two components-

(a) Adobe Photoshop (Roster Graphics): In this, Adobe Photoshop images, we click on cameras and real images which can made up of pixels.

(b) Adobe Illustrator (Vector Graphics): In this vector graphics, we have to use in geometrical figures like lines, drawing, circle, rectangle, etc.

CRT (Cathode Ray Tube)

A cathode ray tube is a specialized vacuum tube in which images are reduced when an electron beam strikes phosphorescent screen.

All CRT's have 3 main elements:

  • An electron run
  • Deflection system
  • Screen
  1. An Electron run: The electron run provides electron beam which is highly conservative stream of electronics.
  2. Deflection system: The Deflection system positions the electron beam on the screen and the screen displays a small spot of light at the point where the electron be strike in.

Output Device Development
ODD

Classification

  • I/P
  • Output
  • Software

Format

UNIT - II

SCAN CONVERSION AND CLIPPING

Clipping: Completely visible figure (like line, rectangle, etc) in a particular screen is called completed clipping.
Clipping refers to the removal part of seeing. Clipping in Computer Graphics is a process of determining which part of graphical object should be display on the screen and which part should be discarded. It helps in rendering only visible portion of an object.
There are two types-
(a) Point Clipping
(b) Line Clipping

(a) Point Clipping: In point clipping decide whether a single point is inside or outside the viewing area.

If a point inside the window, it is displayed on the screen otherwise it is clipped.

(b) Line Clipping: In this line clipping deals with determining the visibility of line segment. Some of various algorithms like these are used to clip lines.
(i) Cohen Sutherland Algorithm
(ii) Liang-Bansky Algorithm

Line Clipping

Scan Converting Lines

In this scan converting lines, involves the process of representing a straight line on a pixel, determining which pixel to turn on approximate. It enables the efficient and accurate(the line) representation of straight lines on the screen.

Some of the Key Steps

(i) End point coordinate: In this end point coordinate can be identified start and end points of a line.

(ii) Slope Calculation:

(iii) Determination of pixel position: In this, we determine the pixel position which pixel should be represent accurately.

Scan Converting Circles

It is process of representing circle on a pixel determining which pixel to turn on to approximate in circular shape.

(i) Circle and Radius: Define the center with coordinates of (h,k). h(horizontal (x-axis),vertical(y0axis)) and specify the radius 'r','h' represents 'x-axis' or coordinates of center of a circle and 'k' represents 'y-axis' or coordinates of center of a circle.

(ii) Plotting: In this plotting, we have to turn on pixels at calculated position to draw a circle.

(iii) Updating pixel position: In this we have to update decision parameter and move to the next pixel position based on algorithm.

(iv) Decision Parameter: Decision parameter is used for evaluate which pixel should be turn on next common method including mid point circle algorithm.

Scan Converting Ellipse

It is process of determining which pixel to activate in order to approximate shape of ellipse on a pixel.

Scan-Converting-Ellipse

(i) Centre of Ellipse: Define the centre of ellipse with point (h,k) and specify the length of semi-measure axis (a) and semi-measure axis (b).

(ii) Updating the pixel position: In this we have to update decision parameter and move to the next pixel position based on algorithm.

(iii) Plotting

(iv) Decision Parameter

Scan Conversion of a Line

A straight line may be defined by two end points.

(i) Clipping Point Clipping: In this process, involves determining whether single point lies within or outside a specified reason and usually a view port or clipping window. The purpose is to decide whether keep or discard point based on its coordinates.

(ii) Point Coordinates: Identify the coordinates (x,y) of a point.

(iii) Clipping Window: In this clipping window defines boundaries of clipping window, rectangular shape with specify x,y range.

(iv) Comparison: Compare the point coordinates with boundaries of a clipping window.

(v) Decision: If the pint is inside the clipping window, it is considered a visible and can be kept for further processing, otherwise if it is outside the window, it is clipped or discarded.

(vi) Clipping Window: Determining what position of the object will be visible and what part will be clipped or discarded.

(vii) View Port: In this process, objects are outside the clipping window considered as invisible.

View-Port

Polygon Clipping (Sutherland-Hodgemann)

  1. Read the coordinates of vertices of a polygon.
  2. Read the coordinates of a clipping window.
  3. Consider the left edge of the window.
  4. Shape resulting intersection and vertices according to the rule.
  5. Repeat for the clipping of the top, right, bottom.
  6. Each time pass resulting list of vertices to the next edge of clipping window.
  7. Stop.

Rules for clipping the polygon edges-

Polygon-Clipping

Clipping against left side-

Polygon-Clipping-Example
Vertex Rule Output
AB in-in B
BC in-in C
CD in-in D
DE in-out P
EA out-in Q A

Clipping against Right side-

Polygon-Clipping-Example
Vertex Rule Output
AB in-out Q'
BC out-in Q2 C
CD in-in D
DD' in-in D'
E'D' in-in E'
E'A in-in A

Clipping against Bottom side-

Polygon-Clipping-Example
Vertex Rule Output
AA' in-in A'
A'B' in-in B'
B'C in-in C
CD in-out P
DD' out-in Q D'
D'E' in-in E'
E'A in-in A

Clipping against Top side-

Polygon-Clipping-Example
Vertex Rule Output
AB' out-in R A'
A'B' in-in B'
B'C in-in C
CP in-in P
PQ in-in Q
QD' in-in D'
D'E' in-in E'
E'A in-out S

UNIT - III (Geometrical Transformation 2D)

Transformation

In this, transformation process are the operations like position, size, shape of an object within graphical scene.
There are two types of transformation-
(a) 2D Transformation
(b) 3D Transformation

Transformation is used to modifying the shapes, object and images in computer graphics.

Transformation in 2D

Translation

It is an object along straight line path from one coordinate location to another.

To find original coordinates / new coordinates:

x' = x + tx

x' = y + ty

Matrix Representation:

[ x' y' ] = [ x y ] + [ tx ty ]

or

[ x' y' ] = [ 1 0 0 1 ] + [ tx ty ]

Example

A(2,2), B(8,2), C(5,5). Translate triangle with distance of tx=5, ty=6

Solution

A' = A + T

A'

= [ 2 2 ] + [ 5 6 ]

A'

= [ 7 8 ]

A' = (7,8) [ New coordinates ]

B'

= [ 8 2 ] + [ 5 6 ]

A'

= [ 13 8 ]

B' = (13,8) [ New coordinates ]

C'

= [ 5 5 ] + [ 5 6 ]

C'

= [ 10 11 ]

C' = (10,11) [ New coordinates ]

Reflection

It is a transformation which evaluates the mirror image of an object.
There are only two types-
(a) Reflection which respect to x-axis
(b) Reflection with respect to y-axis

x' & y' are the new point coordinates of x and y axis.

Re(x) [Reflection with respect to x-axis. If coordinates are (x,y) then new coordinates will be:
x' = x
y' = -y

P' : New Coordinates
P : Original Coordinates

Formula:

P' = Re(x) . P

Matrix Representation:

[ x' y' ] = [ 1 0 0 -1 ] [ x -y ]

P' = Re(x) . P

Re(y) [Reflection with respect to y-axis. If coordinates are (x,y) then new coordinates will be:
x' = -x
y' = y

P' : New Coordinates
P : Original Coordinates

Formula:

P' = Re(y) . P

( x' y' ) = [ -1 0 0 1 ] ( -x y )

P' = Re(y) . P

Example

Reflection of the coordinates of an triangle ABC [A(3,4), B(6,4), C(4,8)] in respect to x-axis and y-axis.

Solution

For x-axis

A'
x'=3
y'=-4
A(3,-4)

B'
x'=6
y'=-4
B(6,-4)

C'
x'=4
y'=-8
C(4,-8)

For y-axis

A'
x'=-3
y'=4
A(-3,4)

B'
x'=6
y'=4
B(-6,4)

C'
x'=4
y'=8
C(-4,8)

Scaling

Scaling is used for changing the size of an object. There are two scaling factors.
Sx = Scaling in x direction
Sy = Scaling in y direction.

Matrix Representation:

[ x' y' ] = [ Sx 0 0 Sy ] + [ x y ]

P' = S.P

There are three conditions:
(s.f = Scaling Factor)

Condition 1: If (s.f) = 1 , object size will not be increased or decreased.
Condition 2: If (s.f) > 1 , object size will be enlarged.
Condition 3: If (s.f) < 1 , object size will be reduced.

Example

In a triangle there are three coordinates [A(2,1), B(5,1), C(4,4)]

Three units in x direction and 2 units in y direction

Solution

[ x' y' ] = [ Sx 0 0 Sy ] + [ x y ]

A'

[ x' y' ] = [ 3 0 0 2 ] + [ 2 1 ]

A(6,2)

B'

[ x' y' ] = [ 3 0 0 2 ] + [ 5 1 ]

B(15,2)

C'

[ x' y' ] = [ 3 0 0 2 ] + [ 4 4 ]

C(12,8)

Rotation

In Rotation we have to rotate an object as in 90° or 45°, etc.
It is a process of changing an angle of an object. Rotation can be performed, clockwise and anti-clockwise.

Example (for proving purpose only)

Φ = phi
Θ = theta

We are taking two coordinates, x and y. x= r cosΦ , y= r sinΦ are at a distance from origin to point p. Φ is an angle between x-axis and point p. Let coordinates of p(x,y) [p(x=r cosΦ, y=r sinΦ)].

For x-axis

x' = r cos ( Φ +Θ)
x' = r [cosΦ . cosΘ - sinΦ . sinΘ]
x' = rcosΦ . cosΘ - rsinΦ . sinΘ
Put x = rcosΦ & y = rsinΦ

x' = xcosΘ - ysinΘ

For y-axis

y' = r sin ( Φ +Θ)
y' = r [sinΦ . cosΘ + cosΦ . sinΘ]
y' = rsinΦ . cosΘ - rcosΦ . sinΘ

y' = ycosΘ - xsinΘ

Formula

[ x' y' ] = [ cosΘ - sinΘ sinΘ cosΘ ] + [ x y ]

P' = R . P

Example

A triangle is given and their coordinates are [A(2,2), B(8,2), C(5,5)] and it is located at an angle 90° , here Θ = 90. Find new coordinates.

A'

[ x' y' ] = [ cosΘ - sinΘ sinΘ cosΘ ] + [ 2 2 ]

Given Θ = 90

[ x' y' ] = [ cos90 - sin90 sin90 cos90 ] + [ 2 2 ]

[ x' y' ] = [ 0 -1 1 0 ] + [ 2 2 ]

A(-2,2)

B'

[ x' y' ] = [ cos90 - sin90 sin90 cos90 ] + [ 8 2 ]

[ x' y' ] = [ 0 -1 1 0 ] + [ 8 2 ]

B(-2,8)

C'

[ x' y' ] = [ cos90 - sin90 sin90 cos90 ] + [ 5 5 ]

[ x' y' ] = [ 0 -1 1 0 ] + [ 5 5 ]

C(-5,5)

Shearing

In this, shape and zie along x-axis and y-axis. It is similar to sliding the layers in the direction to change the object.
If p(x,y) are original coordinates and new coordinates are p'(x',y')

X-Shearing: Here, y coordinates remains same.

x' = x + shx . y
y = y

Matrix Representation:

[ x' y' ] = [ 1 shx 0 1 ] [ x y ]

Y-Shearing: Here, x coordinates remains same.

x' = x
y = y + shy . x

Matrix Representation:

[ x' y' ] = [ 1 0 shy 1 ] [ x y ]

Example

Here, we have three coordinates [A(2,2), B(1,1), C(3,1)], 1 unit in x shearing and 1 unit in y shearing.

For X-Shearing
x' = x + shx . y
y' = y

A'

x' = 2 + 1 x 2 = 4
y' = 2
A(4,2)

B'

x' = 1 + 1 x 1 = 2
y' = 1
B(2,1)

C'

x' = 3 + 1 x 1 = 4
y' = 1
C(4,1)

For Y-Shearing
x' = x
y' = y + shy . x

A'

x' = 2
y' = 2 + 1 x 2
A(2,4)

B'

x' = 1
y' = 1 + 1 x 1
B(1,2)

C'

x' = 3
y' = 1 + 1 x 1
A(3,2)

Note

Click the button below to download:

Where to now?

  • Home
  • Software Engineering
  • Database Management System
  • Optimization Techniques
  • Mathematics III
  • Contact/Feedback
  • Go To Top