Classification of Visible-Surface Detection Algorithms
The Visible-Surface Detection Algorithms is broadly divided into two parts
- Object-Space methods
- Image-Space methods
Object space method compares objects and parts of objects to each other within the scene definition to determine which surface is visible.
In image space, algorithm visibility is decided point by point at each pixel position on the projection plane.
- Back-Face Detection is simple and fast object space method.
- It identifies back faces of polygon based on the inside-outside tests.
- A point (x, y, z) is inside if (Ax+By+Cz+D) less than 0 where A, B, C, and D are constants and this equation is nothing but the equation of polygon surface.
- We can simplify test by taking normal vector N= (A, B, C) of polygon surface and vector V in viewing direction from eye as shown in figure
- Fig for Visible-Surface Detection Algorithms, vector V in the viewing direction and back-face normal vector N of a polyhedron.
- Then we check condition if 𝑉 ∙ 𝑁 > 0 then the polygon is back facing.
- If we convert object description in projection coordinates and our viewing direction is parallel to zv then v= (0,0,vz) and 𝑉 ∙ 𝑁 = 𝑉𝑧𝐶.
So now we only need to check the sign of C.
- In right-handed viewing system V is along negative zv And in that case. If C less than 0 the polygon is backface.
- Also we cannot see any face for which C=0.
- So in general for right-handed system If 𝐶 <=0 polygons is back facing.
- A similar method can be used for the left-handed system.
- In the left-handed system, V is along the positive Z direction and a polygon is back face if 𝐶 ≥ 0.
- For a single convex polyhedron such as the pyramid by examining parameter C for the different plane we identify back faces.
- So far the scene contains only nonoverlapping convex polyhedral, back face method works properly.
- For other objects such as concave polyhedron as shown in the figure below we need to do more tests for determining back face.