0% found this document useful (0 votes)
0 views

Computer graphics answer

The document discusses key concepts in computer graphics, including clipping, the Hodgman algorithm, and the Cohen-Sutherland line clipping algorithm. It also explains the Midpoint Circle algorithm for drawing circles, as well as differences between raster scan and random scan displays, and the construction of CRTs. Additionally, it covers shadow masking techniques used in color CRT displays.

Uploaded by

Adarsh Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Computer graphics answer

The document discusses key concepts in computer graphics, including clipping, the Hodgman algorithm, and the Cohen-Sutherland line clipping algorithm. It also explains the Midpoint Circle algorithm for drawing circles, as well as differences between raster scan and random scan displays, and the construction of CRTs. Additionally, it covers shadow masking techniques used in color CRT displays.

Uploaded by

Adarsh Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Let's break down these computer graphics concepts concisely!

What do you mean by Clipping?

Clipping is the process of removing parts of a graphical object that are outside of a specified
viewing window or viewport. It's essential for displaying only the visible portions of a scene.

Explain Hodgeman Algorithm?

The Hodgman polygon clipping algorithm clips a polygon against each edge of a convex
clipping window sequentially. For each edge of the window, it processes the vertices of the
polygon and determines which vertices and line segments should be kept to form the clipped
polygon. It processes the polygon's edges one by one against each clipping edge, building a new
polygon at each step.

OR

Discuss Cohen Sutherland line clipping algorithm.

The Cohen-Sutherland algorithm is an efficient way to clip lines against a rectangular clipping
window. It works by assigning a 4-bit binary code to each endpoint of the line based on its
position relative to the window boundaries (Top, Bottom, Right, Left).

1. Region Codes: Each endpoint gets a code. If a point is inside the window, its code is 0000.
Otherwise, each bit of the code indicates its position (e.g., 1000 for above, 0100 for below, 0010
for right, 0001 for left).
2. Trivial Accept: If both endpoints have a code of 0000, the entire line is inside and accepted.
3. Trivial Reject: If the bitwise AND of the codes of both endpoints is not 0000, the line is entirely
outside one of the window edges and can be rejected.
4. Clipping: If neither trivial accept nor reject occurs, the line intersects the window. An endpoint
outside the window is selected, and the line is clipped against the corresponding window
boundary. The code for the new endpoint is calculated, and the process repeats.

Q2. Calculate Rotation with the respect to any arbitrarily point (h.k).

To rotate a point (x,y) about an arbitrary point (h,k) by an angle θ, we perform the following
steps:

1. Translate: Translate the point (x,y) so that the rotation point (h,k) becomes the origin. The new
coordinates are (x′,y′)=(x−h,y−k).
2. Rotate: Rotate the translated point (x′,y′) about the origin by the angle θ. The new coordinates (x
′′,y′′) are given by: x′′=x′cosθ−y′sinθ y′′=x′sinθ+y′cosθ
3. Translate Back: Translate the rotated point (x′′,y′′) back by adding (h,k) to bring the rotation
point back to its original position. The final rotated coordinates (xrot,yrot) are: xrot=x′′
+h=(x−h)cosθ−(y−k)sinθ+h yrot=y′′+k=(x−h)sinθ+(y−k)cosθ+k
OR Write algorithm for Mid Point Circle algorithm with a suitable example

Midpoint Circle Algorithm:

This algorithm efficiently draws a circle by deciding which of two possible pixels is closer to the
true circle boundary at each step. It only calculates points for one octant (e.g., from 0 to 45
degrees) and uses symmetry to find the rest.

Algorithm:

1. Input: Circle radius r and center (xc,yc).


2. Initialize:
o Start with the first point on the circle in the first octant: (x,y)=(0,r).
o Initialize the decision parameter: p=1−r.
3. Iterate: While x<y:
o Plot the current point (x+xc,y+yc) and its 7 symmetric points:
 (y+xc,x+yc)
 (y+xc,−x+yc)
 (x+xc,−y+yc)
 (−x+xc,−y+yc)
 (−y+xc,−x+yc)
 (−y+xc,x+yc)
 (−x+xc,y+yc)
o If p<0:
 Choose the pixel to the right.
 Increment x: x=x+1.
 Update the decision parameter: p=p+2x+1.
o Else (p≥0):
 Choose the pixel diagonally down and to the right.
 Increment x: x=x+1.
 Decrement y: y=y−1.
 Update the decision parameter: p=p+2x−2y+1.
4. Plot the last point: When x=y, plot (x+xc,y+yc) and its symmetric points.

Example (Circle with radius 4, center (0, 0)):

1. Initialize: (x,y)=(0,4), p=1−4=−3.


2. Iteration 1 (x=0,y=4,p=−3<0): Plot (0, 4) and symmetric points. x=1,p=−3+2(1)+1=0.
3. Iteration 2 (x=1,y=4,p=0≥0): Plot (1, 4) and symmetric points. x=2,y=3,p=0+2(2)−2(3)+1=−1.
4. Iteration 3 (x=2,y=3,p=−1<0): Plot (2, 3) and symmetric points. x=3,p=−1+2(3)+1=6.
5. Iteration 4 (x=3,y=3,p=6≥0): Plot (3, 3) and symmetric points. x=4,y=2,p=6+2(4)−2(2)+1=11.
(Stop as x>y is false, but we continue until x≥y)
6. Iteration 4 (corrected) (x=3,y=3,p=6≥0): Plot (3, 3) and symmetric points.
x=4,y=2,p=6+2(4)−2(2)+1=11.
7. Iteration 5 (x=4,y=2,p=11≥0): Plot (4, 2) and symmetric points. x=5,y=1,p=11+2(5)−2(1)+1=20.
8. Iteration 6 (x=5,y=1,p=20≥0): Plot (5, 1) and symmetric points. x=6,y=0,p=20+2(6)−2(0)+1=33.
9. Iteration 7 (x=6,y=0,p=33≥0): Plot (6, 0) and symmetric points. x=7,y=−1. Stop.

Q3. Explain any two of the following:

A. Random Scan and Raster Scan display

 Raster Scan Display: The electron beam sweeps across the screen, row by row, from top to
bottom. The intensity of the beam is modulated to create pixels along each scan line. The entire
screen is refreshed at a constant rate. Common in TVs and computer monitors.
 Random Scan (Vector Scan) Display: The electron beam is directed only to the parts of the
screen where the image is to be drawn. It traces out the lines and curves of the objects directly.
Requires a display list (instructions for drawing). Used in some specialized applications like
vector graphics displays and older oscilloscopes.

B. Shadow Masking

Shadow masking is a technique used in color CRT (Cathode Ray Tube) displays to ensure that
each electron beam (red, green, blue) strikes the correct phosphor dot on the screen. A thin metal
plate with tiny holes (the shadow mask) is positioned just behind the phosphor screen. The holes
are precisely aligned with the red, green, and blue phosphor dot triads. When the electron beams
pass through the shadow mask, they are focused to hit only their corresponding color phosphor
dots, producing a clear and colored image.

C. Construction of CRT

A Cathode Ray Tube (CRT) consists of:

1. Electron Gun: Emits a beam of electrons. It includes a heated filament (cathode), a control grid
(to regulate beam intensity), and accelerating anodes (to focus and speed up the electrons).
2. Deflection System: Typically magnetic coils (deflection yokes) that create magnetic fields to
steer the electron beam horizontally and vertically across the screen.
3. Vacuum Tube: A glass envelope that maintains a vacuum, allowing the electrons to travel
without colliding with air molecules.
4. Phosphor Screen: The front surface of the CRT coated with phosphorescent material. When
struck by the electron beam, the phosphors emit light, creating the visible image. In color CRTs,
the screen has triads of red, green, and blue phosphor dots.
5. Shadow Mask (in Color CRTs): A perforated plate behind the phosphor screen to ensure color
purity.

You might also like