Simple Hidden Line and Surface Algorithms
Having drawn a cube and other wire objects we soon become irritated by the lack of solidity in the figures. We would like to consider solid objects, in which case the facets at the front of the object will obviously restrict the view of the facets (and boundary lines) at the back. In order to draw pictures of such objects we have to introduce a hidden surface algorithm; or a hidden line algorithm if we wish to draw all, but only, the visible lines on the object. There are many, many such algorithms — some elementary for specially restricted situations, others very sophisticated for viewing general complicated scenes. The time limitations of microcomputers bar us from implementing the very complex algorithms. In the case of the Spectrum we have also the limitation that we cannot draw more than two colours in a character block, which therefore restricts us to line drawings. Nevertheless, by limiting the types and number of objects in the scenes, it is possible to get most acceptable pictures. In chapter 12 we discuss a relatively complex algorithm, but here we consider two special types of scene — we use the properties implicit in these special configurations to minimise the work needed to discover which surfaces and lines are hidden. Later in this chapter we shall give a simple method for drawing mathematically defined three-dimensional surfaces, but to start we consider an algorithm for drawing a single solid convex body in three-dimensional space.
Unable to display preview. Download preview PDF.