The haloed line effect for hidden line elimination.

T H E H A L O E D L I N E E F F E C T F O R H I D D E N LINE E L I M I N A T I O N . A r t h u r Appel C o m p u t i n g Systems D e p a r t m e n t IBM T h o m a s J. W a t s o n R e s e a r c h C e n t e r Y o r k t o w n Heights, N e w York 10598 F. J a m e s R o h l f D e p a r t m e n t of Ecology and Evolution State University of N e w York at Stony Brook Stony Brook, L o n g Island, N e w York 1 1 7 9 4 A r t h u r J. Stein C o m p u t i n g Systems D e p a r t m e n t IBM T h o m a s J. W a t s o n R e s e a r c h C e n t e r Y o r k t o w n Heights, N e w York 10598 T h e haloed line effect is a technique w h e r e w h e n a line in three-dimensional space passes in front of a n o t h e r line, a gap is p r o d u c e d in the projection of the m o r e distant line. T h e gap is p r o d u c e d as if an o p a q u e halo s u r r o u n d e d the closer line. This m e t h o d for a p p r o x i m a t e hidden-lineelimination is a d v a n t a g e o u s b e c a u s e explicit s u r f a c e equations are not necessary. T h e relative depth of lines, axes, curves a n d lettering is easily perceived. This t e c h n i q u e is especially suitable for the display of finite e l e m e n t grids, t h r e e - d i m e n s i o n a l c o n t o u r m a p s a n d ruled surfaces. W h e n the lines or curves on a s u r f a c e are closer t h a n the gap size, the gaps p r o d u c e d close up to p r o d u c e a complete hidden-line-elimination. A simple but efficient i m p l e m e n t a t i o n is described w h i c h can be used in the r e n d e r i n g of a variety of t h r e e - d i m e n s i o n a l situations. ABSTRACT: C. R. Categories: 3.69, 8.1, 8.2 K e y words: H a l o e d line effect, t h r e e - d i m e n s i o n a l space, h i d d e n line elimination, finite e l e m e n t , c o n t o u r m a p s , ruled surfaces. P R I O R ART: D e t e r m i n i n g w h i c h lines s h o u l d not be d r a w n in a t h r e e d i m e n s i o n a l picture is called hidden line elimination. This has been of continuing interest (1-5). T h e essential task of hidden line elimination is to d e t e r m i n e w h e t h e r a b o u n d e d s u r f a c e lies b e t w e e n the viewpoint and the line or point being considered for drawing, and w h e n this occurs th~ point or line s e g m e n t is invisible and is not drawn. Most t e c h n i q u e s for h i d d e n line elimination a s s u m e s o m e s u r f a c e topology. T h e m o s t c o m m o n a s s u m p t i o n is to consider the s c e n e being r e n d e r e d as being a p p r o x i m a t e d by triangular or r e c t a n g u l a r p a t c h e s (6, 7) or b o u n d e d planes (8, 9). T h e r e has been s o m e work with q u a d r i c s u r f a c e s (10, 11). T h e floating horizon t e c h n i q u e (12) and variants (13, 14) are popular b e c a u s e the f o r m a t of data storage is the s a m e as that used for o t h e r calculations a n d is usually a p p r o p r i a t e for m o s t e x p e r i m e n t a l or statistical p r e s e n t a t i o n s . Some effort has been m a d e toward hidden line elimination w h e r e the data is stored in two or t h r e e - d i m e n s i o n a l raster arrays (15, 16). B A S I C TECHNIQUE: T h e haloed line effect is illustrated in Figure 1 a n d is a c o m m o n device in hand d r a w n technical illustration. For this effect, an imaginary region, a halo, is a s s u m e d to s u r r o u n d Figure 1 - These are three computer renderings of an approximate human head. Each in a different style, respectively, wire frame, haloed line effect and the usual surface dependent hidden line elimination. The bottom picture is the more realistic presentation but the middle picture which appears more like a crystal gives some knowledge of all the lines on the object. This style may be preferable for depictions of structures or finite element networks. ©1979 ACM O-89791-004--4/79/0800--151 See Copyright Pg. $00.75 1.51 t h r e e - d i m e n s i o n a l lines w h i c h can o b s c u r e any lines that pass b e h i n d the halo. W h e n the lines used to describe a s u r f a c e f o r m a t h r e e dim e n s i o n a l grid a n d the grid spacing is smaller t h a n the size of the halo, t h e n a c o m p l e t e h i d d e n line" e l i m i n a t i o n results. This is illustrated in Figure 2. T h e haloed line effect technique offers several advantages: a b It is easily p r o g r a m m e d . V a r i a t i o n of transparency. the halo size enables control of points on the display a n d their relative or a b s o l u t e d e p t h could be d e t e r m i n e d by a n y t h r e e - d i m e n s i o n a l p r o j e c t i o n s c h e m e . T h e r e are t h r e e entry points. T h e first initializes the line c o u n t to zero; the second stores the e n d points of a line; a n d the third signals that the last line has b e e n stored a n d starts the haloing processing a n d g e n e r a t i o n of d r a w i n g c - T h e r e are virtually no rules of topology or s u r f a c e description. Real or implied s u r f a c e s are n o t u s e d and n e e d not be specified. T h e i n p u t to the haloed line effect p r o c e s s o r is almost the s a m e as m i g h t be u s e d to d r a w a wire f r a m e picture, h e n c e this t e c h n i q u e is easily a d a p t e d to p r o g r a m s or s y s t e m s already m a k i n g wire f r a m e pictures. T h e haloing tends to a c c e n t u a t e s u r f a c e c o n t o u r s a n d the dark a n d the light p a t t e r n of ruled surfaces. This m e t h o d is tolerant of modelling and c o m p u t a t i o n a l error in the original data. M e m o r y r e q u i r e m e n t s are minimized b e c a u s e the space usually r e q u i r e d to store s u r f a c e p a r a m e t e r s and b o u n d a r i e s is not necessary. d - e - f - g - Figure 2 - F o r satisfactory results, the h a l o e d line e f f e c t c a n not be rigorously i m p l e m e n t e d . For e x a m p l e lines parallel or nearly parallel to a line with a halo o u g h t not to be o b s c u r e d by this halo otherwise the a p p a r e n t c o n t o u r of objects will be destroyed. T h e result of this c o m p r o m i s e is t h a t small line s e g m e n t s may, almost at r a n d o m , be left on a r e n d e r i n g as illustrated in Figure 3. T h e s e m a y be eliminated by additional processing b u t this extra work m a y s u b v e r t the a d v a n t a g e s of the haloed line effect. A n o t h e r c o m p r o m i s e with rigorous i m p l e m e n t a t i o n is that an error t o l e r a n c e m u s t be used w h e n one line passes behind a n o t h e r line. A c c u m u l a t e d calculation errors m a y c a u s e two lines that intersect in t h r e e - d i m e n s i o n a l space to halo erroneously. Also, if a rigorous d e t e r m i n a t i o n of halo gapping based u p o n i m a g i n a r y haloes is a t t e m p t e d , artificial haloes w o u l d h a v e to be c r e a t e d w h i c h w o u l d be a m a j o r u n d e r t a k i n g a n d w o u l d not be very useful. It is t h e a p p r o x i m a t e solution to this p r o b l e m w h i c h is of value. Five nested algebraic surfaces rendered with the haloed line effect. While some haloing is inconsistent, the overall effect is vivid. This picture demonstrates that the haloed line effect probably cannot be perfectly programmed. Efforts to reduce penetration of haloes by short lines cause other errors or will require topological knowledge which obviate the value of this technique. D E T A I L S OF I M P L E M E N T A T I O N : T h e r e are m a n y possible p r o g r a m m i n g tactics suitable for the haloed line effect. T h e o p t i m u m code would have to take into a c c o u n t the display technology, the p r e f e r r e d application language, the available storage space and the p r e f e r r e d data s t o r a g e media. T h e p r o c e d u r e we h a v e devised is satisfactory as i m p l e m e n t e d in F O R T R A N , o p e r a t i n g on a V M / 1 6 8 c o m p u t e r with pictures being d r a w n on varied storage scopes, printer plotters and a photo c o m p o s e r . T h e p r o g r a m was written to be used w h e r e t h e location of Figure 3 - A picture of three nested algebraic surfaces. Lines parallel to closer lines can penetrate through the haloes of the closer lines. 152 c o m m a n d s . T h e best way to store lines is in picture plane display coordinates D X ( K , L ) , D Y ( K , L ) , a n d s o m e m e a s u r e of d e p t h D T ( K , L ) . W h e r e L is the line c o u n t a n d a n d D X ( I , L ) , D Y ( 1 , L ) , and D T ( I , L ) are the coordinates of the e n d point with the g r e a t e r D Y value. K is 2 for the o t h e r e n d of the line. Some typical lines as stored are s h o w n in Figure 4. T h e haloing p r o c e d u r e is as follows: 1. A s s u m e s o m e halo gap size G. tolerance T O L . Assume some depth I z ,- +DX TYPICAL DX - t/YP,eAL °Y / ' /2/ /" ~:J¢ +DY 5~PICTURE \TYPICAL DT PLANE , /Te..--J - ~ / 6 /~/// ~:_/ 2. E x t e n d e a c h line at both ends a distance G on the picture plane. This is illustrated in Figure 5, a n d will allow a halo gap at the ends of the lines. T a k e e a c h line one at a time. This is line I. Set a c o u n t e r NE to zero. N E is the edges the line I crosses. This m u s t be equal to twice the n u m b e r of lines that line I that h a v e haloes that i n f l u e n c e line I. n u m b e r of halo an even n u m b e r pass in front of t h e visibility of . ~ 3 TYPICAL LINE STORAGE: LINE END I END 2 OXl,DYI,DTI DX2,DY2,DT2 DX3,DY3,DT3 DX2,DY2,DT2 DXI,DYI,DTI DX3,DY3,0T3 DX4,DY4,DT4 DXS,0YS,DT5 DX6,DY6,DT6 DX5,DYS, DT5 DX6,DY6,DT6 OXT, DY7,DT7 DX7,DYT, DT7 DX4,DY4,DT4 3. 4. 5. T a k e each o t h e r line in the scene one at a time. This is line J. For intersection testing on the picture plane use the e x t e n d e d length of line J. This will help preserve the continuity of haloes a r o u n d a surface. Some errors m a y be c a u s e d in open structural drawings such as in Figure 1, but these will not be serious. If the D Y ( 2 , J ) c o o r d i n a t e of line J are g r e a t e r t h a n D Y ( 1 , I ) go back to step 5. If the DY ( I , J) coordinate of line J is less t h a n D Y (2,I) go back to step 5. If both D X coordinates of line J are smaller t h a n the D X coordinates of line I go back to step 5. Figure 4 - An oblique drawing of the projection of a simple scene upon the picture plane and the preferred listing of data. z 6. 7. NEW END POINT FOR UNE I / / ~ / /,~, ~_..~i~-/LINE ,~/~ ~~ FOR LINE I OF ~ - PROJECTION 2 PLANE I "~PICTURE 8. LINE I 9. If both D X coordinates of line J are g r e a t e r t h a n the D X coordinates of line I go back to step 5. OF 10. If both D T coordinates of line J are greater t h a n the D T coordinates of line I go back to step 5. 1 l, T e s t to d e t e r m i n e if the projection of line J crosses the projection of line I. If the line projections do not cross go back to step 5. 12. Calculate the exact location on e a c h line, I and J, w h e r e they cross. Calculate the relative d e p t h of lines I a n d J at this crossing point. If line J is not at least T O L distance in front of I go back to step 5. T h e filtering operations of steps 6 thru 12 w h i c h r e d u c e the average effort r e q u i r e d to d e t e r m i n e w h e t h e r two lines i n t e r s e c t are s h o w n in Figure 6. 13. T h e halo of line J c a n i n f l u e n c e the visibility of line I. Increment NE=NE+2. Store t h e d i s t a n c e f r o m t h e starting point of line I to w h e r e it passes into the halo of line J as T E ( N E - I ) . Store the distance f r o m the starting point of line I to w h e r e it passes f r o m behind the halo of line J as T E ( N E ) . Set visibility state m a r k e r s I G Q ( N E ! ) = - 1 and I G Q ( N E ) = I . T h e halo a r o u n d line J c a n be NEW SPACIAL POSITIONOF NEW END POINT FOR LINE I FOR HALO EFFECT TH,SSEG--T ~,.-~ \ e . ~ ~ / ~ I I OF LINE , I WILL NOT BE DRAWN Figure 5 - An oblique drawing of the projection of two lines onto the picture plane. Line 1 which is being tested for gapping must be extended slightly as shown so as to detect that it penetrates the halo of line 2. a p p r o x i m a t e d economically by two lines parallel to line J a n d two circular arcs. 14. If N E for line I is zero, just d r a w line I a n d go back to step 2. If N E is larger t h a n 2 sort T E ( N E ) a n d the m a r k e r s I G Q ( N E ) on the basis of TE. 15. S u m up the r u n n i n g m e a s u r e of h o w m a n y haloes obs c u r e t h e line I along its length by adding up the values of I G Q along its length. Only those sections of line I 153 w h e r e the sum of I G Q is zero are visible and should be drawn. Any segment of line I where the sum of I G Q is less than zero are hidden by one or m o r e haloes and should not be drawn. This is illustrated in Figure 7. 16. D r a w only the visible segments of line I that occur within its original length. 17. Go back to step 2 until all the lines in the picture have been processed. The sequence of testing described above has been found to be optimal for pictures similar to Figure 2. For different types of pictures other techniques may be better. This procedure is simple and can be easily p r o g r a m m e d with some simple plane geometry functions. Figure 8 demonstrates some particularly useful capabilities, Specifically the haloing of lettering and axis markings. Figure 9 thru 12 are additional d e m o n s t r a t i o n s of the haloed line effect. All illustrations were produced with the same haloing program. Some experimental pictures have been made where the gap size was made to vary with the difference in depth of lines, but these w e r e confusing. Apparently the halo gap size should be constant. EXECUTION TIME The execution time of a hidden line elimination p r o g r a m is determined by several factors. The primary influence is the geometrical strategy which takes into account the mathematical character of the objects or scene to be rendered and the style in which the picture is to be made. A secondary influence is the specific embodiment of the geometrical strategy in a c o m p u t e r program. Hidden line elimination p r o g r a m s can also be tuned to take advantage of some geometric properties of objects being rendered and the characteristics of the processing c o m p u t e r or ancillary h a r d w a r e . Most probably the m o s t i m p o r t a n t factor in the speed of a hidden line elimination p r o g r a m is the sophistication and dedication of the p r o g r a m m e r . F o r example, the use of optimal sorting algorithms, the measurem e n t and minimization of p r o g r a m s t a t e m e n t execution counts, and the use of optimizing compilers can improve speed by an order of magnitude. W h e n directly measuring a hidden line elimination program, the design and orientation of the test shape can bias the results. This has been observed to be especially true w h e n measuring the execution time of haloed line effect pictures. When generating a typical algebraic surface, similar to that s h o w n in Figure 3, the execution time could vary considerably with a change in viewpoint. The gap size of the halo has an unpredictable effect u p o n execution time. Generally a larger gap size tends to increase the execution time, but some objects have been drawn w h e n the reverse has been observed. The gap size should be decided upon aesthetically. //PICTURE PLANE , \/6 I +7"f£ f /1 UNE 6 l LINE 8 FINAL / DISPLAY AFTER HALO PROCESSING ~~ : : / % 1 t i P L-• S s -~-/7,x.~G 5 / 4-1 -1 FO~ Figure 6 - The various filtering tests to determine when a line can halo another line. Line 1 is under test for haloing. For ease of explanation we can ignore the small extensions of line 1. Line 2 is obviously above line 1. Line 3 is obviously below line 1. Line 4 is obviously too far to the left. Line 5 is obviously too far to the right. Line 6 is behind line 1. Line 7 does not cross line 1. Only line 8 can cause a halo gap in line 1. Figure 7 - A typical situation where the value of IGQ is used to determine the visible segments of line I. Notice that the halo gap of line J3 is subject to an end effect. The numbers along line I are the original TE index. The dimensions are the running IGQ counts which are how many haloes obscure a line on a particular segment. 154 Hidden line elimination programs are usually evaluated upon the dependence of execution time on picture complexity. The most common measures of picture complexity being the line count, or polygonal surface count. Obviously for the haloed line effec.t, only the line count, N, is meaningful. For algebraic surfaces such as Figures 2, 3, 10 and 11, the execution time has been observed to be proportional to N * * ( 3 / 2 ) . Rendering a picture of an algebraic surface containing 180 lines required about 1.15 seconds and a similar surface with 1,740 lines required about 26.07 seconds. POTENTIAL A L G O R I T H M I C I M P R O V E M E N T S : The techniques described in this paper for implementing the haloed line effect are early experimental results and are a compromise between complexity and an acceptable quality of graphics. The major calculation task is to detect which lines cross and considerable improvement in this regard is to be expected if the lines in the picture would be subdivided into smaller groups by clipping (17, 18). The halo entrance and exit marker technique used in steps 13 and 14 are similar to the concept of quantitative invisibility described in a previous paper on polyhedral hidden line elimination (19). This should suggest that there may be many ways in which the haloed line effect can augment or benefit from the usual hidden line elimination techniques. One assumption of the implementation is that all the lines used for halo obstruction will be drawn. Additional lines can be added to a scene, such as patterns on planes, which are not intended to be drawn but which can obscure other lines. The result can be an approximation to complete hidden line elimination. J i 9PI RCqL ON ~ SPHERE "H"},~]~]~.~ }1'" Figure 8 - A simple picture containing lettering and axis markings. The haloed line effect can be used economically with these graphic elements. It may be interesting to compare the haloed line effect with other hidden line elimination techniques, but this is like comparing apples with oranges as the character of pictures and processing are so different. Referring to Figure 1, the wire frame picture took about .2 seconds of CPU time, the haloed line effect picture required about .69 seconds and the complete hidden line elimination required about 2.57 seconds. In addition, the complete hidden line technique picture needed about 3 seconds set up time for the calculation of surface equations, line equations and the usual organizational data structuring which the haloed line effect does not need. While these measurements are typical of the programs used, this should not imply that the haloed line effect is particularly faster than the usual hidden line elimination techniques. Most probably the floating horizon methods of Wright (12) have the same performance characteristics for algebraic surfaces. Figure 9 - A series of architectural drawings prepared using the haloed line effect. The data consisted only of lines in a three-dimensional space and were not organized in any other way. 155 CONCLUDING R E M A R K S : 7. The most important aspect of the haloed line effect is the simplicity and geometrical independence of the technique. Scientists and engineers, inexperienced in the special techniques of three-dimensional computer graphics, are easily taught to use the haloing program because there are virtually no rules of topology or organization of the input line set. 9. We would like to thank Cliff Nass for integrating the haloed line effect into the United States Military Academy Grat~hics Compatibility System (GCS) and for many helpful ideas for improving the quality of the pictures. Thanks are due to Robert O'Hara for his architectural data used for Figure 9. A. Appel, "Hidden Line Elimination for Complex Surfaces", I B M T E C H N I C A L D I S C L O S U R E B U L L E T I N , Vol. 18, No. 11, April 1976, pp. 3873-3876. Bruce G. Baumgart, "A Polyhedron Representation for Computer Vision", P R O C E E D I N G S A F I P S N A T I O N A L COMPUTER C O N F E R E N C E 1975, Vol. 44, pp. 589-596. L. I. Lieberman, M. A. Wesley, M. A. Lavin, '~4 GEOM E T R I C M O D E L L I N G S Y S T E M FOR A U T O M A T E D M E C H A N I C A L A S S E M B L Y , " IBM Research Report RC 7089, April 25, 1978. 10. Ruth A. Weiss, "BE VISION: a package of IBM 7090 Fortran programs to draw orthographic views of combinations of plane and quadratic surfaces", J O U R N A L O F T H E A C M , Vol. 13, No. 2, April 1966, pp. 194-204. l l . Peter Woon and Herbert Freeman, "A Procedure for Generating Visible Line Projections of Solids Bounded by Quadric Surfaces", P R O C E E D I N G S I F I P C O N G R E S S I N F O R M A T I O N P R O C E S S I N G , North Holland, 1971, pp. 1120-1125. 12. Thomas J. Wright, "A Two-Spaced Solution to the Hidden Line Problem for Plotting Functions of Two Variables", I E E E T R A N S . ON C O M P U T E R S , Vol. c-22, No. i , January 1973, pp. 28-33. 13. A. Appel, S. W. Handelman and A. J. Stein, "Hidden Line Elimination for Semi-Convex Slices", I B M TECHN I C A L D I S C L O S U R E B U L L E T I N , Vol. 20, No. 7, December 1977, pp. 2917-2920. Figure 10 - An algebraic surface. 14. Wm. Randolph Franklin and Harry Graphic Display of Discrete Spatial Maps", Computer Graphics, Vol. 12, No. Quarterly Report of SIGGRAPH-ACM. R. Lewis, "3-D Data by Prism 3, August 1978, pp. 70-75. REFERENCES: 1. J. Encarnacao, "Survey of and New Solutions for the Hidden-Line Problem", P R O C E E D I N G OF S Y M P O S I U M ON C O M P U T E R GRAPHICS, Delft, Netherlands, October 1970, pp. 26-28. I. E. Sutherland, R. F. Sproull and R. A. Schumacker, "A Characterization of Ten Hidden-Surface Algorithms", C O M P U T I N G S U R V E Y S , Vol. 6, No. 1, March 1974, pp. 1-55. Various techniques are discussed in Chapter 5 of Wolfgang K. Giloi, I N T E R A C T I V E C O M P U T E R G R A P H I C S , Prentice-Hall Inc, Englewood Cliffs, N, J., 1978. Various techniques are discussed in Chapter 14 of William M. Newman and Robert F. Sproull, P R I N C I P L E S OF I N T E R A C T I V E COMPUTER G R A P H I C S , McGrawHill Book Company, New York, 1973. J. G. Griffiths, "Bibliography of Hidden-Line and Hidden Surface Algorithms", C O M P U T E R - A I D E D DESIGN, Vol. 10, No. 3, May 1978, pp. 203-206. C. Wylie, G. W. Romney, D. C. Evans, and A. Erdahl, "Halftone Perspective Drawings by Computer", PROC. A F I P S FJCC 1976, Vol. 31, 49. 15. Thomas Wright, "Visible Surface Plotting Program", C O M M U N I C A T I O N S O F THE ACM, Vol. 17, No. 3, March 1974, pp. 152-155. 16. A. Appel and A. J. Stein, "Cellular Automata for Hidden-Line Elimination", I B M T E C H N I C A L D I S C L O S U R E BU L L ET IN , Vol. 17, No. 2, July 1974, pp. 586589. 17. I. E. Sutherland and R. F. Sproull, "A Clipping Divider," Proc. A F I P S FJCC 1968 Conference, Vol. 33, Part I, pp. 765-776. 18. James F. Blinn and Martin E. Newell, "Clipping using Homogeneous Coordinates", Computer Graphics, Quarterly Report of SIGGRAPH-ACM, Vol. 12, No. 3, August 1978, pp. 245-251. 19. A. Appel, "The Notion of Quantitative Invisibility and the Machine Rendering of Solids", Proc. A C M National Conference 1967, pp. 387-393. 2. 3. 4. 5. 6. 156 Figure 11 - A n a l g e b r a i c surface. F i g u r e 12 - A series of p i c t u r e s b a s e d u p o n statistical d a t a . All h a l o e d line e f f e c t p i c t u r e s in this p a p e r w e r e p r o c e s s e d by the s a m e p r o g r a m . 157
x

Log In

or reset password

Reset Password

Enter the email address you signed up with, and we'll send a reset password email to that address

Academia © 2012