CG Viva+questions+&ANSWERS
CG Viva+questions+&ANSWERS
CG Viva+questions+&ANSWERS
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
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
P(u)=
Pk Bez k,n(u)
Pk B k,d(u)
bspline
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
Depth-Buffer 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
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.
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