12
GRT GROUP OF EDUCATIONAL INSTITUTIONS GRT INSTITUTE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING COMPUTER GRAPHICS UNIT – I (2 Marks and 16 Marks Answers) PART – A 1. What are output primitives? The basic building blocks for pictures are referred to as output primitives. They include character strings and geometric entities, such as points, straight lines, curved lines, filled areas, (polygons, circles, etc) and shapes defined with arrays of color points. 2. What are the attributes of output primitives? Attributes are the properties of the output primitives; that is, an attribute describes how a particular primitive is to be displayed. They include intensity and color specifications, line styles, text styles and area filling patterns. 3. What are segments or structures or objects? Pictures can be subdivided into component parts, called structures or segments or objects depending on the software package in use. Each structure defines one logical unit of the picture. 4. What are local coordinates or master coordinates or modeling coordinates? We can construct the shape of individual objects in a scene within separate coordinate reference frames called

Computer Graphics Key

Embed Size (px)

Citation preview

Page 1: Computer Graphics Key

GRT GROUP OF EDUCATIONAL INSTITUTIONS

GRT INSTITUTE OF ENGINEERING AND

TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

COMPUTER GRAPHICS

UNIT – I (2 Marks and 16 Marks Answers)

PART – A

1. What are output primitives?

The basic building blocks for pictures are referred to as output primitives. They

include character strings and geometric entities, such as points, straight lines, curved lines,

filled areas, (polygons, circles, etc) and shapes defined with arrays of color points.

2. What are the attributes of output primitives?

Attributes are the properties of the output primitives; that is, an attribute describes

how a particular primitive is to be displayed. They include intensity and color specifications,

line styles, text styles and area filling patterns.

3. What are segments or structures or objects?

Pictures can be subdivided into component parts, called structures or segments or

objects depending on the software package in use. Each structure defines one logical unit of

the picture.

4. What are local coordinates or master coordinates or modeling coordinates?

We can construct the shape of individual objects in a scene within separate coordinate

reference frames called modeling coordinates or local coordinates or master coordinates.

5. What are world coordinates?

Once individual object shapes have been specified, we can place the objects into

appropriate positions within the scene using a reference frame called world coordinates.

6. What are device or screen coordinates?

The world coordinate description of the scene is transferred to one or more output

device reference frames for display. These display coordinate systems are referred to as

device or screen coordinates.

7. What are normalized device coordinates?

A graphics system first converts world coordinate positions to normalized device

coordinates before final conversion to specific device coordinates. This makes the system

independent of the various devices that might be used at a particular workstation.

Page 2: Computer Graphics Key

8. What is GKS?

GKS stands for Graphical Kernel System. The International Standards Organization

(ISO) and ANSI adopted this system as the first graphics software standard. GKS was

originally designed as a 2D’al graphics package; a 3D’al GKS extension was subsequently

developed.

9. What is PHIGS?

PHIGS stands for Programmer’s Hierarchical Interactive Graphics Standard. It is an

extension of GKS. It is software standard and approved by the standards organization.

Increased capabilities for object modeling, color specifications, surface rendering, and

picture manipulations and provided in PHIGS.

10. Define language binding.

Standard graphics functions are defined as a set of specifications that is independent

of any programming language. A language binding is defined for a particular high level

programming language. This binding gives the syntax for accessing the various standard

graphics functions in the language.

11. What are CGI and CGM?

Standardization for device interface methods is given in the Computer Graphics

Interface (CGI) system. And the Computer Graphics Metafile (CGM) system specifies

standards for archiving and transporting pictures.

12. Write down the Cartesian slope-intercept equation for a straight line

The Cartesian slope-intercept equation for a straight line is

y = m. x + b

where m – represents the slope of the line

b – the ‘y’ intercept

13. What does DDA algorithm?

The digital differential analyzer (DDA) algorithm is an incremental scan-conversion

method. It performs the calculations at each step using results from the preceding step.

14. What does Bresenham’s line algorithm?

Bresenham’s line algorithm is a highly efficient incremental method for scan-

converting lines. It produces mathematically accurate results using only integer addition,

subtraction, and multiplication by 2, which can be accomplished by a simple arithmetic shift

operation.

Page 3: Computer Graphics Key

15. List out the drawbacks of DDA algorithm.

The accumulation of round off error in successive additions of the floating-point in-

crement can cause deviation of pixel from true line path

Rounding operations and floating-point arithmetic

16. What is the advantage of circle drawing algorithms?

Any circle-generating algorithm can take advantage of the circle’s symmetry to plot

eight points for each value that the algorithm calculates.

17. What is eight-way symmetry of a circle?

Reflecting each calculated point around each 45° axis uses eight-way symmetry.

18. List out the points of the eight-way symmetry of circle

The eight-way symmetry of a circle uses the following points:

P1=(x, y) P2=(y, x) P3=(-y, x) P4=(-x, y)

P5=(-x, -y) P6=(-y, -x) P7=(y, -x) P8=(x, -y)

19. What are the two methods to define a circle?

There are two standard methods of mathematically defining a circle centered at the

origin.

The first method defines a circle with the second-order polynomial equation

y2 = r2 – x2

where x – the ‘x’ coordinate

y – the ‘y’ coordinate

r – the circle radius

The second method of defining a circle makes use of trigonometric functions

x = r cos θ y = r sin θ

where θ – current angle

r – circle radius

x – ‘x’ coordinate

y – ‘y’ coordinate

20. What are testing conditions used in midpoint circle algorithm?

Midpoint circle algorithm is based on the following function for testing the spatial

relationship between an arbitrary point (x, y) and a circle of radius ‘r’ centered at the origin:

f (x, y) = x2 + y2 – r2

< 0 means (x, y) inside the circle= 0 means (x, y) on the circle> 0 means (x, y) outside the circle

Page 4: Computer Graphics Key

10001001 1010

0000 00100001

0100 01100101

Xmin

Xmax

Ymax

Ymin

21. What are the inequalities used in a point clipping?

Point clipping is based the following inequalities

xmin ≤ x ≤ xmax and ymin ≤ y ≤ ymax

where xmin , xmax, ymin and ymax define the clipping window

A point (x, y) is considered inside the window when the inequalities all evaluate to

true.

22. List out the clipping categories used in Cohen-Sutherland algorithm?

The Cohen-Sutherland algorithm uses the following clipping categories:

(1) Visible – both endpoints of the line lie within the window

(2) Not visible – the line definitely lies outside the window

(3) Clipping candidate – the line is in neither category (1) nor (2)

23. Sketch the region code values of Cohen-Sutherland algorithm

A 4-bit region code is assigned to each endpoint of the line. Starting from the leftmost

bit, each bit of the code is set to true or false according to the scheme. The values of the bit

positions are:

Bit #1 Endpoint is above the window

Bit #2 Endpoint is below the window

Bit #3 Endpoint is to the right of the window

Bit #4 Endpoint is to the left of the window

The region code scheme is as follows:

24. List out the inequalities used in Liang-Barsky algorithm For point (x, y) inside the

clipping window,

xmin ≤ x1 + ∆x . u. ≤ xmax

ymin ≤ y1 + ∆y . u. ≤ ymax such that 0 ≤ u ≤ 1

where

∆x = x2 – x1 and ∆y = y2 – y1

The four inequalities are:

pk . u ≤ qk k=1, 2, 3, 4

Page 5: Computer Graphics Key

where

p1 = - ∆x q1 = x1 – xmin (left)

p2 = ∆x q2 = xmax – x1 (right)

p3 = -∆y q3 = y1 – ymin (bottom)

p4 = ∆y q4 = ymax – y1 (top)

25. Write down line clipping algorithms

(1) Cohen-Sutherland line clipping algorithm

(2) Liang-Barsky line clipping algorithm

(3) Nicholl-Lee-Nicholl (NLN) line clipping algorithm

26. List out the polygon clipping algorithms.

(1) Sutherland-Hodgeman polygon clipping algorithm

(2) Weiler-Atherton polygon clipping algorithm

(3) Liang-Barsky polygon clipping algorithm (extension of line clipping)

27. What are the primitive types of clipping algorithms?

(1) Point clipping (2) Line clipping (3) Polygon (area) clipping

(4) Curve clipping (5) Text clipping

28. Define window.

A world coordinate area selected for display is called a window.

29. Define viewport.

An area on a display device to which a window is mapped is called a viewport.

30. Define viewing transformation

The mapping of a part of a world coordinate scene to device coordinates is referred to

as a viewing transformation

31. Define clipping or clipping algorithm.

Any procedure that identifies portions of a picture that are either inside or outside of a

specified region of space is referred to as a clipping or clipping algorithm.

Page 6: Computer Graphics Key

32. List out the applications of graphics

Computer aided design (CAD)

Presentation graphics

Computer art

Entertainment

Education and training

Visualization

Image processing

Graphical user interface

33. What is pixel?

Picture element. The smallest unit (point) of an image displayed on screen. The

quality of an image depends on the number of pixels per inch that make up the image.

34. Disadvantages of DDA Line drawing algorithm?

It relies on floating-point operations to compute pixel positions Implications:

• Computationally inefficient because floating-point operations are slow

• Round-off errors accumulate, producing incorrect line drawings (e.g., if m is

rounded to 0.9 even though it is equal to 0.99, lines of length > 10 will be drawn

inaccurately)

35. What is Cohen-Sutherland algorithm?

1. The more efficient Cohen-Sutherland Algorithm performs initial tests on a line to de-

termine whether intersection calculations can be avoided.

Steps for Cohen-Sutherland algorithm

1. End-points pairs are check for trivial acceptance or trivial rejected using the

outcode.

2. If not trivial-acceptance or trivial-rejected, divided into two segments at a clip

edge.

3. Iteratively clipped by testing trivial-acceptance or trivial-rejected, and divided

into two segments until completely inside or trivial-rejected.

36. What is mean by transformation?

Transformation means that the ability to simulate the manipulation of objects in space

is referred to as transformation.

Page 7: Computer Graphics Key

37. List out the fundamental operations of (geometric) transformation.

The fundamental transformation operations are:

(1) Translation(2) Rotation (3) Scaling

(4) Reflection (5) Shear

38. What is shear?

A transformation that distorts the shape of an object such that the transformed shape

appears as if the object were composed of internal layers that had been caused to slide over

each other is called a shear.

39. Define viewing transformation.

The mapping of a PART of a world-coordinate scene to device coordinates is referred

to as a viewing transformation.

39. Mention the uses of splines.

Splines are used in graphics applications to design curve and surface shapes to

digitize drawings for computer storage

To specify animation paths for the objects or the camera in a scene

In CAD applications, splines include the design of automobile bodies, aircraft and

spacecraft surfaces and ship hulls

40. What are control points?

We specify a spline curve by giving a set of coordinate positions called control point,

which indicates the general shape of the curve.

41. What is pivot point ?

The pivot point is the point in space around which all rotations, all scalings and all

mirror transformations are centered. We can chose among five general modes for our pivot

points which can be selected from a drop list on the header of any 3D area as seen here in

Pivot Point Modes.

42. What is General Fixed Point Scaling?

1. Translate object so that the fixed point coincides with the coordinate origin

2. Scale the object with respect to the coordinate origin

3. Use the inverse translation of step 1 to return the object to its original position

Concatenating the matrices for these three operations produces the required scaling matrix.

43. What is rotation?

A rotation is a movement of an object in a circular motion. A two-dimensional object

rotates around a center (or point) of rotation. A three-dimensional object rotates around a line

called an axis.

Page 8: Computer Graphics Key

44. What is reflection?

A reflection is a transformation that produces a mirror image of an object. The mirror

image for a two-dimensional reflection is generated relative to an axis of reflection by

rotating the object 180 about the reflection axis.

PART - B

1. DIGITAL DIFFERENTIAL ANALYZER: (DDA) (8)

(i)Introduction (1)

(ii)Algorithm (5)

(iii)Advantages (1)

(iv)Disadvantages (1)

2. BRESANHARMS TECHNIQUE:

(i)Introduction (1)

(ii)Algorithm (6)

(iii)Advantages (1)

3. CIRCLE GENERATING ALGORITHMS: (16)

(i)Introduction (3)

(ii)Diagram (6)

(ii)Algorithm (6)

(iii)Advantages (1)

4. ELLIPSE GENERATING ALGORITHMS: (16)

(i)Introduction (3)

(ii)Diagram (6)

(ii)Algorithm (6)

(iii)Advantages (1)

5. COHEN SUTHERLAND LINE CLIPPING :( 8)

(i)Introduction (1) (ii) Algorithm (5) (iii) Diagram (2)

7. SUTHERLAND HODGEMAN LINE CLIPPING :(8)

(i)Introduction (1) (ii) Algorithm (5) (iii) Diagram (2)

8. 2D TRANSFORMATIONS :( 16)

(i)Introduction (3) (ii) Diagram (6) (ii) Description (7)