Answers CG
Answers CG
(1) Top-View : In this projection, the rays that emerge from the top of the polygon
surface are observed.
2) Side-View : It is another type of projection orthographic projection where the side
view of the polygon surface is observed
3)Front-view : In this orthographic projection front face view of the object is observed.
a.2) Axonometric : Axonometric projection is an orthographic projection, where the
projection lines are perpendicular to the plane of projection, and the object is rotated
around one or more of its axes to show multiple sides.
Slope:- m= (y2-y1)/(x2-x1)
a) If the line passes through top or the line intersects with the top boundary of the
window.
x = x + (y_wmax – y)/m
y = y_wmax
b) If the line passes through the bottom or the line intersects with the bottom boundary
of the window.
x = x + (y_wmin – y)/m
y = y_wmin
c) If the line passes through the left region or the line intersects with the left boundary
of the window.
y = y+ (x_wmin – x)*m
x = x_wmin
d) If the line passes through the right region or the line intersects with the right
boundary of the window.
y = y + (x_wmax -x)*m
x = x_wmax
5) Now, overwrite the endpoints with a new one and update it.
6) Repeat the 4th step till your line doesn’t get completely clipped
14. Explain Quadtree and Octree with suitable example. Explain advantage and disadvantage
of Quadtree and Octree.
Quadtrees are trees used to efficiently store data of points on a two-dimensional space. In
this tree, each node has at most four children. We can construct a quadtree from a two-
dimensional area using the following steps:
Divide the current two dimensional space into four boxes.
If a box contains one or more points in it, create a child object, storing in it the two
dimensional space of the box
If a box does not contain any points, do not create a child for it
Recurse for each of the children.
Quadtrees are used in image compression, where each node contains the average colour
of each of its children. The deeper you traverse in the tree, the more the detail of the
image. Quadtrees are also used in searching for nodes in a two-dimensional area. For
instance, if you wanted to find the closest point to given coordinates, you can do it using
quadtrees.
Octree is a tree data structure in which each internal node can have at most 8 children.
Like Binary tree which divides the space two segments, Octree divides the space into at
most eight-part which is called as octanes. It is used to store the 3-D point which takes a
large amount of space. If all the internal node of the Octree contains exactly 8 children,
then it is called full Octree. It is also useful for high-resolution graphics like 3D computer
graphics.
The Octree can be formed from 3D volume by doing the following steps:
15. Explain how Bezier Curve are represented parametrically. Given a Bezier curve with 4
controls points- B0[1 0] , B1[3 3] , B2[6 3] , B3[8 1] Determine any 5 points lying on
the curve.