Вы находитесь на странице: 1из 13

Viva questions(Computer graphics)

1. Definition of computer graphics(CG)


It is a branch of computer science which deals with creation,
manipulation & storage of images in computer
2. application areas of CG
CAD,Presentation graphics,Computer art,Entertainment,Education &
Training,Visualization, Image Processing
3. Explain the function of initgraph().
initgraph initializes the graphics system by loading a graphics driver
from disk (or validating a registered driver), and putting the system into
graphics mode.
To start the graphics system, first call the initgraph function. initgraph
loads the graphics driver and puts the system into graphics mode. You
can tell initgraph to use a particular graphics driver and mode, or to
autodetect the attached video adapter at run time and pick the
corresponding driver.

4. Explain the parameters in initgraph().


For initgraph there are three parameters

They are *graphdriver, graphmode & pathtodriver

1)

*graphdriver
Integer that specifies the graphics driver to be used. You can give
graphdriver a value using a constant of the graphics_drivers
enumeration type.

graphics_drivers constant
DETECT
CGA
MCGA

Numeric value
0 (requests autodetect)
1
2

EGA
EGA64
EGAMONO
IBM8514
HERCMONO
ATT400
VGA
PC3270

3
4
5
6
7
8
9
10

2)*graphmode
Integer that specifies the initial graphics mode (unless *graphdriver =
DETECT). If *graphdriver = DETECT, initgraph sets *graphmode to the
highest resolution available for the detected driver. You can give *graphmode
a value using a constant of the graphics_modes enumeration type.

3)*pathtodriver
Specifies the directory path where initgraph looks for graphics drivers (*.BGI)
first.
1. If they're not there, initgraph looks in the current directory.
2. If pathtodriver is null, the driver files must be in the current directory.
5)Why we are giving it as gd=DETECT.
Then the init graph will automatically detect the graphics driver and its mode.
6)Resolution.
It is defined as the maximum no: of points that can be displayed with out
overlap on aCRT
OR
It can be defined as the no: of points per centimeter that can be plotted
horizontally or vertically
EG:
640x480
800x600
024x768
Resolution of your monitor is 640x480

7)Aspect ratio
Ratio of no: of points in the horizontal to the no: of points in the vertical
Commonly used aspect ratio is 4:3

8)Explain raster scan & random scan displays


In raster scan system electron beam is swept across the screen one row at a
time from top to bottom. Here the electron beam returns to the leftmost
position one line down & scan again & repeat this to cover the entire screen.
But in random scan systems the electron beam is directed only to the parts of
the screen where a picture is to be drawn
9)Horizontal retrace
It is the returning of the electron beam to the leftmost position of the
screen one scan line down (in raster scan system)
10)vertical retrace
After scanning all the scan lines in the screen the electron beam returns to
the top most positions in the screen to start the scanning process
again.this diagonal movement of the electron beam is called vertical
retracing
11)Refresh rate
It is the no: of times per second that the screen is refreshed
It is measured in Hertz.
Common refresh rate values are 56,60,65,80,85,90,100,120 etc
12)Pixel(picture element)
It can be defined as the smallest size object or color spot that can be
displayed & addressed on a monitor
13)Vector graphics
Images are composed of paths
It use mathematical relationships between points & path connecting them to
describe an image
14)Raster graphics
Images are composed of pixels.Raster images are known as bitmap image.

15)Display processor or graphics controller


Purpose is to free the CPU from graphics operations
Main task is scan conversion
scan conversion: it is the process of digitizing picture definition given in the
application pgm in to a set of intensity values to be stored in the refresh
buffer
16)Display list
Graphic commands are stored in the display file
It is a file storing all commands & when this file is interpreted image is
displayed on the screen.
17)Explain the following algorithms
DDA line drawing
Bresenhams line drawing
Bresenhams circle drawing
Midpoint circle drawing
18)Disadvantages of DDA line drawing algm
time consuming
accumulation of round off errors
it is orientation dependent.
19)Advantages of Bresenhams line drawing algm
Accurate & efficient
Avoids round off function
Uses incremental & integer calculations
20)What is the initial decision parameter of.
a) Bresenhams line drawing p0=2dy-dx
b)Bresenhams circle drawing p0=3-2r
c)Midpoint circle drawingp0=5/4r
21) Name two graphics standards
Generally accepted standards for CG are
GKS-graphics kernel system
PHIGS-programmers hierachical interactive graphics system

23.Explain 8 way symmetry of a circle


Circle is symmetrical.symmetrical abt X,Y & diagonal axix.
All pixels around a circle can be generated by calculating only the points with
in the sector from x=0 to x==y (45 deg).becoz if we get one point we can find
other 7 points becoz of the symmetry of the circle.
24.Equation of line
y=mx+b
25. Equation of a circle
x2+y2=z2
26.Equation for translation,Rotation & scaling
Translation

x1=x+ tx
y1=y+ty
Where tx & ty are translation distances
Rotation

x1=r cos( +)
= r cos cos-rsin sin
y1= r sin( +)
= r cos sin+rsin cos
Scaling
x1=x*sx
y1=y*sy
27.Explain transformation matrix for
a)translation
b)rotation
c)scaling
d)reflection
e)shear
28. Explain Normalized device coordinates
They are device independent units.
In these unit screen measures 1 unit wide & 1 unit high
29.Explain Windowing transformations

It is the mapping of a part of world coordinate to view port coordinate


30.Steps in windowing transformations
Steps:
1) construct world coordinate scene using modeling coordinate transformations
2) convert world coordinate to viewing coordinate
3) map viewing coordinate to normalized coordinate
4) map normalized coordinate to viewport coordinate
31. Explain Viewport
This is the rectangular region in the screen which is selected for displaying
the object
32.Explain Point clipping
33. Explain line clipping
34Explain Cohen Sutherland line clipping
Algorithm steps
1. find the 4 bit region code of the two end points of the line.
Each bit in the region code is set according tothe following
Bit 1 is set if x< xwmin ie if ithe end point is left
Bit 2 is set if x>xwmax ie if it is right
Bit 3 is set if y>ywmax ie if it is below
Bit 4 is set if y<ywmin ie if it is top
2. check whether the line end point is completly inside the clip
window
If line end point is completly inside the clip window then the region
code of the line endpoints are 0000
3. check whether the line end point is completly outside the clip
window.
This is done by perfoming logical AND operation of the region
code & if we get 1 as result then the line is completly outside the clip
window
4.

check for intersection with vertical or horizontal boundary and


find the new intersection points
i f the intersection of the line is with the vertical boundary then
its new x value will be xwmin or xwmax and new y value will be
according to th eqn y=y1+m(x-x1) , if(x1,y1) & (x2,y2)
will be the line end point coordinate ,x will be xwmin or xwmax

i f the intersection of the line is with the horizontal boundary then


its new y value will be ywmin or ywmax and new x value will be
according to th eqn x=x1+(y-y1)/m , if(x1,y1) & (x2,y2) will
be the line end point coordinate ,y will be ywmin or ywmax

35.Explain Sutherland Hodgeman polygon clipping


36. Explain Parrel projection
Here the view of a 3d object is generated by projecting points on the object
surface along parallel lines on to the display plane.
37. Explain perspective projection
Here the view of a 3d object is generated by projecting points on the object
Surface along converging path to the display plane.
38. Explain Quadric surfaces.give eg:
Spheres,ellipsoids,tori,paraboloid,hyperboloids
39. Explain Blobby objects
Objects that do not maintain a fixed shape,but change their surface characteristics
in certain motions or when in proximity to other to other objects
40. Explain Spline.
Spline curve refers to any composite curve formed with polynomial sections
satisfying certain boundary conditions at the end points
41. Explain approximation spline
In it the curve doent pass through any of the control points
42. Explain interpolation spline
In it the curve pass through all of the control points
43. Explain control graph
It is a set of connected line segments connecting the sequence of control points.
It is usually displayed to remind the a designer abt the control point ordering
44. Explain convex hull
It is a convex polygon boundary enclosing the set of control points
45.Explain different parametric continuity conditions
Zero,first & second order

Zero order parametric continuity


It ensures that the two curves meet at a common end point.
First order parametric continuity
It ensures that the curve is zero order continuous also their parametric first
derivative(slopes or tangents) are equal at the joining points.
Second order parametric continuity
It ensures that the curve is zero & first order continuous also their parametric
second derivatives are same at the intersection
46.Explain different geometric continuity conditions
Zero order geometric continuity
Same as Zero order parametric continuity
First order geometric continuity
It ensures that the curve is zero order continuous also their parametric first
derivative(slopes or tangents) are proportional at the joining points.
Second order geometric continuity
It ensures that the curve is zero & first order continuous also their parametric
second derivatives are proportional at the intersection

47.differences between geometric & parametric continuity.


Geometric continuity describes the shape of the curve and the parametric
continuity describes the shape but it add restrictions onthe speed with
which the parameter traces out the curve
48.Bezier curve.
It is a mixture of interpolating & approximation splines.
It has 2 interpolated end points & 2 or more approximated intermediary c
ontrol points
49.Equation for Bezier curve

P(u)=

Pk Bez k,n(u)

Where Bez k,n(u)=C(n,k) uk (1-u)n-k


50.Blending function of Bezier curve
Bez k,n(u)=C(n,k) uk (1-u)n-k
51.Properties of Bezier curve
Bezier curve always passes through first & last control points
Bezier curve always lies with in the convex hull of control points
Bezier blending functions are all positive and their sum is always 1

52. Explain Bezier surfaces.Equations.


53.Bspline curve.-blending function

Equation of Bspline curve is P(u)=

Pk B k,d(u)

54.difference between Bezier & Bspline curve.


bezier

bspline

Interpolate 1st and last control


points & approximates all other
points
Degree depends onthe no: of
control points

Approximates all control points

Degree is independent of the no: of


control points

No local control over the shape


Allows local control over the shape
of the curve
of the curve
55.Properties of bspline
Curve has the degree d-1
For n+1 control points the is drawn with n+1 blending functions.
Blending functions is defined over d sub interval in the total range of u
The range of parameter u is divided into n+d+1 sub intervals
56.Types of Bspline.
Uniform : Here the spacing between the knot values is constant
Non uniform:Spacing between the knot values is not constant
Open:combination of uniform & non uniform Bsplines
57. Explain Bspline surfaces-equation
58.Explain boundary & flood fill algorithm.
59.What are control points
They are the set of coordinate positons through which a curve is drawn.
60.How the degree of the general equation of a Bezier curve is determined.
It is one less than the no: of control points used
61.What is the value of u in the generation of a Bezier curve
It will be in the range 0 to 1

62. How will you determine that a line is completely outside a clip window?
Refer qno:34
63. . How will you determine that a line is completely inside a clip window?
Refer qno:34
64.difference between boundary fill & flood fill algm
Boundary fill algm fills the polygon by checking the boundary colour but
flood fill algm fills the polygon by checking the previously filled colour
65.Disadvantages of raster graphics
When the raster images are scaled up it produces jaggies(stair case
appearance)
Raster images require high resolution
Can be overcome by anti aliasing
anti aliasing
It is the application of subtle transition inthe pixels along the egdes of images
to minimize the jagged effect.
66.Advantages of vector graphics
vector images are smooth at any size or resolution
67. illumination model
lighting model or Shading model is used to calculate the intensity of light that we
should see at a given point on the surface of object
68.surface rendering
Surface Rendering algorithms uses the intensity calculations from the
illumination model to determine the light intensity for all projected pixel
positions for the various surfaces in a scene
69 .Diffuse Reflection
Diffuse reflection is the reflection of light from an uneven or granular surface
Such that an incident ray is seemingly reflected at a number of angles
70 .Specular reflection
Specular reflection is the perfect, mirror-like reflection of light from a
surface, in which light from a single incoming direction (a ray) is reflected
into a single outgoing direction.
71. Illumination models types

Local Illumination = direct illumination - considers light traveling directly


from source to surface
Eg: for local illumination models are
Ambient Light model
Diffuse Reflection model
Specular reflection
Warn model

Global Illumination = indirect illumination - takes into account reflection of


light from other surfaces
Eg of global illumination model is Ray tracing

72.different visible surface dection methods .

Back-face detection/removal Explain

Depth-Buffer Method

A-Buffer Method . Explain


Scan-Line Method

Explain

Explain

73.Which visible surface dection method is used in the case of transparent surface

A-Buffer Method
74.Which visible surface dection method is used in the case of overlapping surfaces
Scan-Line Method
75. Different Polygon rendering methods

Constant intensity shading (Flat shading)

Gouraud shading

Phong shading

Explain

Explain

Explain

76.what is the main difference between gouroud shading & phong shading
In gouroud shading first we determine the average unit normal vector
at each polygon vertex
Then Apply an illumination model to each vertex to calculate the vertex
intensity.
And finally Linearly interpolate the vertex intensities over the surface of
the polygon.
But in phong shading first step is same ie determining the average unit
normal vector at each polygon vertex
Then Linearly interpolate the vertex normals over the surface of the polygon
and at last Apply an illumination model along each scanline to calculate
projected pixel intensities for the surface points.
77.What are mach bands.

In Gouroud shading ,the inear intensity interpolation can cause bright or


dark intensity streaks to appear on the surfaces of polygon and they are
called mach bands

78.Explain ray tracing .


Ray Tracing is a global illumination based rendering method.
Ray-tracing is a rendering technique that calculates an image of a scene by
simulating the way rays of light travel in the real world.
79.Explain Gamma correction of intensity

. Gamma correction controls the overall brightness of an image. Images


which are not properly corrected can look either bleached out, or too dark.
Trying to reproduce colors accurately also requires some knowledge of
gamma. Varying the amount of gamma correction changes not only the
brightness, but also the ratios of red to green to blue.Gamma correction also
plays a big role in making images for the WWW.
80. Explain Dithering
Dithering is an imaging technique which allows a bitmap (or a bitmapped device, such
as a screen or printer) to appear to display more colors than are actually possible.

If the bitmap (or bitmapped device) only allows black and white, dithering can be
used to produce an illusion of gray.

If the bitmap (or bitmapped device) allows a palette of colors, then dithering can
produce an illusion of more colors being displayed than are in the palette.

81.Explain fractals.
82.Explain classification of fractals
83.Explain the application of fractals
Fractals are used to model natural objects like mountains,clouds plants and coastlines
etc having irregular or fragmented features.
84.Explain morphing