Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Binary Trees

  1. #1

    Binary Trees

    Hey,

    I've got a question regarding BSP's
    I have read a few documents on the internet that show how you make one with tips and all, but they say that an unbalanced tree is bad
    and it grows or something like that....

    How is this so?

    If you are doing 1 polygon per node, then you are going to have 'N' nodes no matter how the tree is sorted...

    Thanks for any input

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Binary Trees

    I think what they trying to say when they say an unbalanced tree grows, is that when making the tree, if it should become unbalanced, it will tend to grow faster on the unbalanced side. In other words, a slightly unbalanced tree at the beginning can very easily turn into an extremely unbalanced tree in the end.

    Oh, and generally, each node of the BSP has 1 splitting plane not 1 polygon.



    [This message has been edited by DFrey (edited 07-19-2000).]

  3. #3

    Re: Binary Trees

    Thanks very much for replying

    The question I was leading up to is:

    Does the balance of the tree affect anything? Performance/Stability, or anything like that?
    Or is it just the "appearance" of the tree?

  4. #4
    Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Augsburg, Germany
    Posts
    415

    Re: Binary Trees

    An unbalanced tree has the problem of long access time. A balanced tree with 15 items has the depth of 4 walking from the root node. The worst case of a completely unbalanced tree has the depth of 15. So if you search for a specific position in tree it will be faster in a balanced tree.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Binary Trees

    Ditto.

  6. #6

    Re: Binary Trees

    Thanks heaps!!

    It all makes sense to me now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •