CG - Assignment 4
CG - Assignment 4
ASSIGNMENT 4
4. Which shading technique calculates the color of each polygon vertex and then
interpolates the color across the polygon?
A) Phong shading B) Gouraud shading
C) Flat shading D) None of the above
Page 1 of 6
8. Which algorithm is used for clipping polygons?
A) Bresenham's algorithm B) Sutherland-Hodgman algorithm
C) Wailer-Atherton algorithm D) None of the above
10. Which shading technique interpolates vertex normals to determine pixel color?
A) Phong shading B) Gouraud shading
C) Flat shading D) Lambertian shading
Page 2 of 6
3. What is Shearing?
It is transformation which changes the shape of object. The sliding of layers of object occurs.
The shear can be in one direction or in two directions.
Shearing in the X-direction: In this horizontal shearing sliding of layers occur.
Shearing in the Y-direction: Here shearing is done by sliding along vertical or y-axis.
Shearing in X-Y directions: Here layers will slide in both x as well as y direction. The
sliding will be in horizontal as well as vertical direction. The shape of the object will be
distorted.
It is performed by processing the boundary of polygon against each window corner or edge.
First of all entire polygon is clipped against one edge, then resulting polygon is considered,
then the polygon is considered against the second edge, so on for all four edges.
Page 3 of 6
Four possible situations while processing:
1. If the first vertex is an outside the window, the second vertex is inside the window.
Then second vertex is added to the output list. The point of intersection of window
boundary and polygon side (edge) is also added to the output line.
2. If both vertexes are inside window boundary. Then only second vertex is added to the
output list.
3. If the first vertex is inside the window and second is an outside window. The edge
which intersects with window is added to output list.
4. If both vertices are the outside window, then nothing is added to output list.
A more accurate method for rendering a polygon surface is to interpolate the normal vector and
then apply the illumination model to each surface point. This method developed by Phong Bui
Tuong is called Phong Shading or normal vector Interpolation Shading. It displays more realistic
highlights on a surface and greatly reduces the Match-band effect.
A polygon surface is rendered using Phong shading by carrying out the following steps:
Incremental are used to evaluate normals between scan lines and along each scan line. At each
pixel position along a scan line, the illumination model is applied to determine the surface intensity
at that point.
If we want to rotate an object or point about an arbitrary point, first of all, we translate the
point about which we want to rotate to the origin. Then rotate point or object about the
origin, and at the end, we again translate it to the original place. We get rotation about an
arbitrary point.
Page 4 of 6
Step1: Translate point (xc yc) to origin
Page 5 of 6
Page 6 of 6