Computerg 2
Computerg 2
- A fast and simple method for rendering an object with - Also known as Painter’s Algorithm. Binary Space Partitioning (BSP) tree is an efficient method
polygon surfaces is constant intensity shading. - A visible surface detection method that uses both image- for determining visibility when view reference point
- In this method, a single intensity is calculated for each space and object-space operations. changes but the scene are at fixed position.
polygon and the intensity is applied to all the points of - It performs the following two functions: - It involves identifying surfaces that are inside/front and
surface of polygon. Hence, all the points over the surface a) Surfaces are stored in order of decreasing depth. outside/back w.r.t. the partitioning plane at each step of
of the polygon are displayed with same intensity value. b) Surfaces are scan-converted in order, staring with the the space division, relative to the viewing direction.
- Constant shading is useful for quickly displaying the surface of greatest depth. - Start with any plane and find one set of objects behind
general appearance of a curved surfaces. This approach is - It follows following steps: and the rest in the front.
valid if: i. All surfaces in the scene are ordered according to the - In the tree, the objects are represented as terminal
a. Light source is at infinity (𝑁⃗ . 𝐿⃗ is constant on polygon). smallest ‘z’ value on each surface. nodes with front objects as left branches and back objects
b. Viewer is at infinity (𝑉⃗ . 𝑅⃗ is constant on polygon). ii. The surface ‘S’ at the end of the list is then compared as right branches. This algorithm partitions the space into
c. Object is polyhedron and is not an approximation of an against all other surface to see if there are any depth sub divisions until all object list contain no more than
object with a curved surface. overlap. iii. If no overlap occurs then the surface is scan one object
converted and the process is repeated with the next
surface. When there is depth overlap with ‘S’ we make the - Disadvantages:
following tests: - More polygon splitting may occur than in painter’s
a) The bounding rectangle for the two surfaces do not algorithm.
overlap. b) Surface ‘S’ is completely behind the overlapping - Appropriate partitioning hyperplane selection is quite
surface relative to viewing position. complicated and difficult
c) The overlapping surface is completely in front of ‘S’
related to viewing position. d) The boundary edge
projection of the two surfaces do not overlap
Drawback:
- If two or more surfaces alternately obscure each other it
get into an infinite loop
Line Clipping
In line clipping, a line or part of line is clipped if it is outside
the window port. There are three possibilities for the line:
a. Line can be completely inside the window (This line
should be accepted).
b. Line can be completely outside of the window (This line
will be completely removed
from the region).
c. Line can be partially inside the window (We will find
intersection point and draw only
that portion of line that is inside region).