UNIT – IV

Introduction

A major consideration in the generation of realistic graphics displays isidentifying those parts of a scene that are visible from a chosen viewingposition. There are manyapproaches we can take to solve this problem, and numerousalgorithms have been devised for efficient identification of visible objectsfor different types of applications. Some methods require more memory, some involvemore processing time, and some apply only to special types of objects. Decidingupon a method for a particular application can depend on such factors asthe complexity of the scene, type of objects to be displayed, available equipment,and whether static or animated displays are to be generated. The various algorithmsare referred to as visible-surface detection methods. Sometimes thesemethods are also referred to as hidden-surface elimination methods, althoughthere can be subtle differences between identifying visible surfaces and eliminatinghidden surfaces. For wireframe displays, for example, we may not want toactually eliminate the hidden surfaces, but rather to display them with dashedboundaries or in some other way to retain information about their shape.

Backface Culling

  • A simple way to perform hidden surface is to remove all ``backfacing'' polygons.
  • The observation is that if polygon normal is facing away from the viewer then it is ``backfacing.''
  • For solid objects, this means the polygon will not be seen by the viewer.

\

  • Thus, if , then cull polygon.
  • Note that V is vector from eye to point on polygon

You cannot use the view direction for this.

Backface Culling

Not a complete solution

  • If objects not convex, need to do more work.
  • If polygons two sided (i.e., they do not enclose a volume) then we can't use it.

\

  • A HUGE speed advantage if we can use it since the test is cheap and we expect at least half the polygons will be discarded.
  • Usually performed in conjunction with a more complete hidden surface algorithm.
  • Easy to integrate into hardware (and usually improves performance by a factor of 2).

Painter's Algorithm

  • Idea: Draw polygons as an oil painter might: The farthest one first.
  • Sort polygons on farthest z
  • Resolve ambiguities where z's overlap
  • Scan convert from largest z to smallest z

\

  • Since closest drawn last, it will be on top (and therefore it will be seen).
  • Need all polygons at once in order to sort.

z-Buffer Algorithm

•The z or depth buffer–stores the depth of the closest object at each pixel

found so far

•As we render each polygon, compare the depth ofeach pixel to depth in z buffer

–If less, place the shade of pixel in the color buffer andupdate z buffer

Function setpixel(int i, int j, rgb c, real z)

If z > z-buffer(i, j) then

z-buffer(i, j) = z

screen(i,j) = c

Space Partitioning

•Avoid rendering an object when it’s unnecessary

–In many real-time applications, we want to eliminateas many objects as possible within the application.

–Reduce burden on pipeline

–Reduce traffic on bus

•Octree

•BSP tree

Octree

Why do we use BSP trees?

•Hidden surface removal

–A back-to-front painter’s algorithm

•Partition space with Binary Spatial Partition (BSP)Tree

Binary Space Partitioning Tree

•Can continue recursively

–Plane of C separates B from A

–Plane of D separates E and F

•Can put this information in a BSP tree

–Use for visibility and occlusion testing

Key Idea of BSP

•Assume T2 not cross the plane of T1

•If e and T2 on the same side, T1 won’t block

•If e and T2 on different sides, T2 may block


Creating a BSP tree

Back-to-Front Render

Render(node, view){

if node is a leaf

{ draw this node to the screen }

else

if the viewpoint is in back of the dividing line

{

render(front subnode)

draw node to screen

render(back subnode)

}

else the viewpoint is in front of the dividing line

{

render (back subnode)

draw node to screen

render (front subnode)

}

PART – A

  1. What is solid modeling?
  2. What is the use of hidden line removing algorithm?
  3. What is Fractals?
  4. What is geometric fractal?
  5. What is Koch curve?
  6. What is graftals?
  7. What is view distance?
  8. What is the use of control points?
  9. What are the advantages of rendering by patch splitting?
  10. What is surface patch?

PART - B

1. Develop a procedure, based on a back-face detection technique, for identifying all

the visible faces of a convex polyhedron that has different-colored surfaces. Assume

that the object is defined in a right-handed viewing system with the xy-plane as the

viewing surface.

2. Implement a back-face detection procedureusing an orthographic parallel projection

to view visible faces of a convex polyhedron. Assume that all parts of the object are

in front of the view plane, and provide a mapping onto a screen viewport for display.

3. Implement a back-face detection procedure using a perspective projection to view

visible faces of a convex polyhedron. Assume that all parts of the object are in front

of the view plane, and provide a mapping onto a screen viewport for display.

4. Write a program to produce an animation of a convex polyhedron. The object is to

be rotated incrementally about an axis that passes through the object and is parallel

to the view plane. Assume that the object lies completely in front of the view plane.

Use an orthographic parallel projection to map the views successively onto the view

plane.

5. Implement the depth-buffer method to display the visible surfaces of a given polyhedron.

How can the storage requirements for the depth buffer bedetermined from the

definition of the objects to be displayed?

6. Implement the depth-buffer method to display the visible surfaces in a scene containingany number of polyhedrons. Set up efficient methods for storing and processingthe various objects in the scene.

7. Implement the A-buffer algorithm to display a scene containing both opaque and

transparent surfaces.

8. How does the Z buffer algorithm determines which surfaces are hidden?

9. Describe Painter’s algorithm. Give its relative advantages and disadvantages over other

methods.

10. Explain Back face detection method and Depth buffer method.

11. Explain area subdivision and A- Buffer method.

12. Explain Depth sorting method