home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / graphics / 13564 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.1 KB  |  37 lines

  1. Newsgroups: comp.graphics
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!stgprao
  3. From: stgprao@st.unocal.COM (Richard Ottolini)
  4. Subject: Re: Depth Sorting
  5. Message-ID: <1993Jan8.164513.3088@unocal.com>
  6. Sender: news@unocal.com (Unocal USENET News)
  7. Organization: Unocal Corporation
  8. References: <hrpctw.10@pnv.palm.cri.nz>
  9. Date: Fri, 8 Jan 1993 16:45:13 GMT
  10. Lines: 25
  11.  
  12. In article <hrpctw.10@pnv.palm.cri.nz> news@massey.ac.nz (USENET News System) writes:
  13. >I need to be able to display a very complicated three dimensional structure
  14. >consisting of a lot of small unconnected polygons, a whole heap of line
  15. >segments, a few very small ellipsoids, which are probably small enough to
  16. >be approximated by a single polygon each.  I have no problems in performing
  17. >the 3D transformations etc, but I'm having trouble figuring out what exactly
  18. >is the best way of displaying this data.  For a first attempt I'll probably
  19. >just sort the objects in order from back to front and plot them like that,
  20. >but this is not really a good solution.  What I would like is a fairly nice
  21. >algorithm (understandability is preferable to efficiency) that will allow
  22. >me to draw polygons and line segments without objects being drawn over the
  23. >top of objects on front of them.
  24. >
  25. >Does anyone have any such algorithms, (or better still, C code), or know
  26. >where I can look to find something suitable.
  27.  
  28. This question has occurred a couple times recently.
  29. One way to think through an answer is that graphics-geometry algorithms can be implemented
  30. in at least two ways: (1) in the "model space" or geometric description of the object to
  31. be drawn, or (2) the "image space" or coordinates of the drawing surface.
  32. Brute force model space methods tend to be polynomial in cost, that each object must be compared
  33. to each other object.  This can be reduced somewhat by ordering/sorting the model parts.  Oct-trees
  34. os one typoe of ordering.  An image space algorithm is the zbuffer method- recording the depth
  35. of each pixel drawn and comparing it to the existing contents. This algorithm is essentially linear
  36. with the number of objects to be drawn.
  37.