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