Unit I Output Primitives SUBJECT: Graphics and Multimedia Subject Code: CS1354 Year & Sem: III&VI Part A (2 Marks)
Unit I Output Primitives SUBJECT: Graphics and Multimedia Subject Code: CS1354 Year & Sem: III&VI Part A (2 Marks)
Output Primitives
Part A (2 marks):
2. What are the methods used to plot a pixel and get the value in particular pixel
position.
To load a specified color into the buffer at a position corresponding to column x along
scan line y, we will assume we have available a low level procedure of the form
setPixel (x , y)
we able to retrieve the current frame buffer intensity setting for a specified location. We
accomplish this with the low level function.
getPixel (x , y)
4. Define DDA.
The digital differential analyzer (DDA) is a scan conversion line algorithm based on
calculating either Δy = mΔx or Δx=Δy/m.
We sample the line at unit intervals in one coordinate and determine corresponding
integer values nearest the line path for the other coordinate.
b. Furthermore the rounding operation and floating point arithmetic in procedure line
DDA are still consuming.
06.Explain the Symmetry of Circle with neat diagram.
07. Give the various Circle coordinates points calculations in Mid point Circle
drawing algorithm when r = 15 and center is at origin.
Radius:15
If (Xk+1,yk) Then Pk<0
Pk+1=Pk+1+2Xk+1+1
If(Xk+1,Yk+1)then pk>0
Pk+1=Pk+1+2Xk+1+1+2yk+1
P0=5/4-r
=5/4 -15
=-13.8
=-14
08.What are the various Line attributes?
a. Line width
b. Line type
c. Line color
Line type :
setLineType(lt)
1. solid ________
2. dash ------------
3. dotted …………
4. dashed-dot .-.-.-.-.-.-.-.-
Line width:
SetLinewidth scale factor(lw)
Line color
Set polyLine color index(lc)
Test Attributes
The choice of font, which is a set of characters with a particular design style such
as new York, courier, Helvetica, times new roman and various special symbols.
The characters in a selected font can be displayed with assorted underlying styles
(solid, dotted, double) in bold face, in italics and in outline or shadow styles. It
can be done through a function
setTextFont (tf);
Color settings for text are stored in the system attributes list and used by the
procedures. The text color in set by the following function,
setTextcolorIndex (tc);
Or
T(tx2,ty2).T(tx1,ty1)=T(tx1+tx2,ty1+ty2)
Which demonstrate that two successive translation are additive
Scaling
The composite matrix resulting from the product of these three
transformation is
Page number=214(5-35)
13.Explain general Pivot-Point Rotation with neat diagram.
To generate a rotation, we specify a rotation angle and the position P when the pivot point
in at the coordinate origin. In figure r in the constant distance of the point from the origin,
angle φ in the original angular position of the point from the horizontal and θ in the
rotation angle. Using standard trigonometric identifies, we can express the transformed
coordinates in terms of angles θ and φ as
Figure 1.7
14.Explain general Fixed-Point Scaling with neat diagram.
We can control the location of a scaled object by choosing a position, called the fixed
point.that is to remain unchanged after the scaling transformation. Co-ordinate for the
fixed point(Xf,Yf) can be chosen as one of the vertices,the object centroid, or any other
position.
15. What are the various Reflections possible and explain it diagrammatically.
I.reflection of an object about the X axis
Assuming that the clip window is a rectangle in standard position, we save a point p= (x,
y) for display if the following inequalities are satisfied.
Where the edges of the clip window (xw min, xwmax, ywmin, ywmax) Cn be either the
world-coordinate window boundaries or viewpoint boundaries. If any of these four
inequalities is not satisfied; the point is clipped.
16 MARKS
Step 1: Input rx , ry and ellipse center (xc, yc) and obtain the first point on an ellipse
centered on the origin as,
(x0, y0) = (0, ry)
Step 2: Calculate the initial value of the decision parameter inregion 1 as,
P0 = r2- r2xry+ ¼ r2x
Step 3: At each xk position in region 1, starting at k=0, perform the following text:
If pk<0, the next point along the ellipse centered on (0, 0) is (xk+1, yk) and
Pk+1= pk + 2r2yxk+1+r2y
Otherwise, the next point along the circle is (xk+1, yk-1) and
Pk+1 = pk + 2r2yxk+1- 2r2xyk+1+ r2y
With,
2r2yxk+1 = 2r2xyk - 2r2y
2 2
2r2xyk+1 = 2r xyk - 2r x
And continue until 2r2yx > 2r2xy.
Step 4: Calculate the initial value of the decision parameter in region 2 using the last point
(x0, y0) calculate in region 1 as,
p20 = r2y ( x0 + ½ )2 + r2x ( y0 -1)2 – r2xr2y
Step 5: At each yk position in region 2, starting at k=0, perform the following list:
If p2k>0, the next point along the ellipse centered on (0, 0) is (xk, yk-1) and
P2k+1 = p2k – 2r2xyk+1+r2x
Otherwise, the point along the circle is (xk+1, yk-1) and
P2k+1 = p2k+ 2r2yxk+1- 2r2xyk+1 + r2x
Using the same incremental calculations for x and y as in region 1.
Step 6: Determine symmetry points in the other three quadrants.
Step 7: Move each calculated pixel position (x, y) onto the elliptical path centered on (xc,
yc) and plot the coordinate values:
x = x+ xc, y = y + yc
Step 8: Repeat the steps for region 1 until
2r2yx > 2r2xy
Translation
Rotation
Scaling
Other Transformations
Reflection
Shearing
06. Detail about Reflection and shearing.
REFLECTION
Define reflection
Explain various types of relection with diagrams
SHAERING
Define Shaering
Explain various types of shearing with diagrams
Line Attributes
Line Type
Line width
Line Color
Character Attributes
Test Attributes
Marker attributes
Curve attributes
Line Clipping
Area Clipping
Curve Clipping
Text Clipping