ArticleslgStudy

computer science

Hidden-line removal

Hidden-line removal is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Hidden-line removal rather than just read about it. In short: In 3D computer graphics, solid objects are usually modeled by polyhedra. A face of a polyhedron is a planar polygon bounded by straight line segments, called edges.

Hidden-line removal — main illustration
Hidden-line removal — illustration

Key takeaways

  • Hidden-line removal belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Hidden-line removal to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Hidden-line removal from memory before moving on to harder problems.

Reference excerpt

In 3D computer graphics, solid objects are usually modeled by polyhedra. A face of a polyhedron is a planar polygon bounded by straight line segments, called edges. Curved surfaces are usually approximated by a polygon mesh. Computer programs for line drawings of opaque objects must be able to decide which edges or which parts of the edges are hidden by an object itself or by other objects, so that those edges can be clipped during rendering. This problem is known as hidden-line removal. The first known solution to the hidden-line problem was devised by L. G. Roberts in 1963. However, it severely restricts the model: it requires that all objects be convex. Ruth A. Weiss of Bell Labs documented her 1964 solution to this problem in a 1965 paper. In 1966 Ivan E. Sutherland listed 10 unsolved problems in computer graphics. Problem number seven was "hidden-line removal". In terms of computational complexity, this problem was solved by Frank Devai in 1986. Models, e.g. in computer-aided design, can have thousands or millions of edges. Therefore, a computational-complexity approach expressing resource requirements (such as time and memory) as the function of problem sizes is crucial. Time requirements are particularly important in interactive systems. Problem sizes for hidden-line removal are the total number n of the edges of the model and the total number v of the visible segments of the edges. Visibility can change at the intersection points of the images of the edges. Let k denote the total number of the intersection points of the images of the edges. Both k = Θ(n2) and v = Θ(n2) in the worst case, but usually v < k.

Algorithms Hidden-line algorithms published before 1984 divide edges into line segments by the intersection points of their images, and then test each segment for visibility against each face of the model. Assuming a model of a collection of polyhedra with the boundary of each topologically equivalent to a sphere and with faces topologically equivalent to disks, according to Euler's formula, there are Θ(n) faces. Testing Θ(n2) line segments against Θ(n) faces takes Θ(n3) time in the worst case. Appel's algorithm is also unstable, because an error in visibility will be propagated to subsequent segment endpoints. Ottmann and Widmayer and Ottmann, Widmayer and Wood proposed O((n + k) log2 n)-time hidden-line algorithms. Then Nurmi improved the running time to O((n + k) log n). In the worst case, these algorithms take Θ(n2 log2 n) and Θ(n2 log n) time respectively, but they can be faster in practice if k is less than quadratic. Any hidden-line algorithm has to determine the union of Θ(n) hidden intervals on n edges in the worst case. As Ω(n log n) is a lower bound for determining the union of n intervals, it appears that the best one can hope to achieve is Θ(n2 log n) worst-case time, and hence Nurmi's algorithm is optimal. However, the log n factor was eliminated by Devai, who raised the open problem whether the same optimal O(n2) upper bound existed for hidden-surface removal. This problem was solved by McKenna in 1987. The intersection-sensitive algorithms are mainly known in the computational-geometry literature. The quadratic upper bounds are also appreciated by the computer-graphics literature: Ghali notes that the algorithms by Devai and McKenna "represent milestones in visibility algorithms", breaking a theoretical barrier from O(n2 log n) to O(n2) for processing a scene of n edges. The other open problem, raised by Devai, of whether there exists an O(n log n + v)-time hidden-line algorithm, where v, as noted above, is the number of visible segments, is still unsolved at the time of writing.

Parallel algorithms In 1988 Devai proposed an O(log n)-time parallel algorithm using n2 processors for the hidden-line problem under the concurrent read, exclusive write (CREW) parallel random-access machine (PRAM) model of computation. As the product of the processor number and the running time is asymptotically greater than Θ(n2), the sequential complexity of the problem, the algorithm is not work-optimal, but it demonstrates that the hidden-line problem is in the complexity class NC, i.e., it can be solved in polylogarithmic time by using a polynomial number of processors. Hidden-surface algorithms can be used for hidden-line removal, but not the other way around. Reif and Sen proposed an O(log4 n)-time algorithm for the hidden-surface problem, using O((n + v)/log n) CREW PRAM processors for a restricted model of polyhedral terrains, where v is the output size. In 2011 Devai published an O(log n)-time hidden-surface, and a simpler, also O(log n)-time, hidden-line algorithm. The hidden-surface algorithm, using n2/log n CREW PRAM processors, is work-optimal. The hidden-line algorithm uses n2 exclusive read, exclusive write (EREW) PRAM processors. The EREW model is the PRAM variant closest to real machines. The hidden-line algorithm does O(n2 log n) work, which is the upper bound for the best sequential algorithms used in practice. Cook, Dwork and Reischuk gave an Ω(log n) lower bound for finding the maximum of n integers allowing infinitely many processors of any PRAM without simultaneous writes. Finding the maximum of n integers is constant-time reducible to the hidden-line problem by using n processors. Therefore, the hidden-line algorithm is time optimal.

See also Back-face culling Elite (video game)

References

External links Patrick-Gilles Maillot's thesis, an extension of the Bresenham line-drawing algorithm to perform 3D hidden-lines removal; also published in MICAD '87 proceedings on CAD/CAM and Computer Graphics, page 591, ISBN 2-86601-084-1.

Illustrations

Hidden-line removal: A wire-frame image using hidden-line removal
A wire-frame image using hidden-line removal

Worked examples

Example 1 — a first encounter with Hidden-line removal

Start with the simplest possible case. Write down what Hidden-line removal claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Hidden-line removal before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Hidden-line removal ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Hidden-line removal

In research
Hidden-line removal appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Hidden-line removal in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Hidden-line removal is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D rendering, Computer graphics algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Hidden-line removal outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Hidden-line removal” →

How to study Hidden-line removal in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Hidden-line removal means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Hidden-line removal out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Hidden-line removal in simple terms?

In 3D computer graphics, solid objects are usually modeled by polyhedra. A face of a polyhedron is a planar polygon bounded by straight line segments, called edges.

Why does Hidden-line removal matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Hidden-line removal?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Hidden-line removal.

Tags

  • 3D rendering
  • Computer graphics algorithms

Keep exploring