POV-Ray : Newsgroups : povray.programming : Depth sort renderer question : Re: Depth sort renderer question Server Time
29 Jul 2024 04:23:36 EDT (-0400)
  Re: Depth sort renderer question  
From: Stephen Horn
Date: 24 Sep 1998 01:45:29
Message: <3609CE81.5038@osu.eduX>
Diego Krota wrote:
> 
> Greetings.
> 
> I'm developing for my software D-form a depth sort renderer.
> For the first draft I did a raw bubblesort and it worked OK.
> 
> A last question. I confronted the average Z coordinates of each poly to
> determine the nearer. Are there better methods?
> 

Yes!  If you are sorting polygons then you can store depth information
in a data structure called a BSP tree (Binary Spatial Partitioning
Tree).

BSP trees are built by BSP tree compilers.  They simply take the data of
the polygons in and output the corresponding tree.   Once the tree is
built, there is no need to do depth sorting of any kind no matter where
the veiwpoint is, because back-to-front information is already stored in
the shape of the tree.  For each position that the veiwpoint takes, its
current position is 'clipped' into the tree, and then an inorder walk of
the tree gives you the polygons in back-to-front order.

The best source that I can refer you to is a book called "The Black Book
of Graphics Programming" by John Abrash.  Beware, the book is very large
and tends to be expensive. According to the book though, Abrash has
published many (if not all) of these articles in Doctor Dobb's Journal,
which may be on the internet in some form.  The book contains a CD with
the full text and more.  Chances are, this CD may have been copied
illegally onto a Warez server somewhere.  Good luck.
.
Steve Horn


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.