7. Hidden Line Removal

Brock University
COSC 3P98 Computer Graphics
Instructor: Brian J. Ross



Hidden line and surface removal


Hidden lines and surfaces


Types of algorithms

  1. Visible-line determination: examine edge geometry, and determine edge segments that are visible or are hidden
  2. Z-buffer: device-precision algorithm that records the visible object found at each pixel
  3. List priority algorithms: object-precise algorithms that sort objects such that when drawn in that order, a correct rendering of hidden surfaces occurs
  4. Scan-line algorithms: image-precise algorithms that determine visibility one scan-line at a time
  5. Area subdivision algorithms: divide-and-conquer applied to object areas
  6. Ray tracing: determine visible object by tracing line from user eye to each pixel in scene

... and others


Coherence


Hidden line removal



Hidden surfaces


Efficiency techniques


Efficiency:


Backface elimination


Z Buffering


Z buffer


OpenGL: Z buffer

glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
glEnable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT); 
  • can combine with colour clearing:
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    
  • And that's it! must remember to clear the z-buffer whenever you draw a new frame


    List-Priority algorithms


    Depth-sort

    1. sort all polygons according to smallest z coordinate of each (ie. distance to viewer)
    2. resolve overlaps (split polygons if necessary)
    3. scan convert polygons from farthest to nearest



    Area subdivision (Warnock's Algorithm)


    Area subdivision


    Ray Tracing


    Ray Tracing


    Summary: hidden surface


    References:



    Back to COSC 3P98 index

    COSC 3P98 Computer Graphics
    Brock University
    Dept of Computer Science
    Copyright © 2023 Brian J. Ross (Except noted figures).
    http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/hiddenlines/
    Last updated: March 13, 2023