This is more of a conceptual question than a coding question. I have figured out the basic concepts of a BSP tree but am having trouble wrapping my head around the positioning. I have figured out that to find my current location in the BSP tree, I keep recursively iterating through the tree moving to the right if I am in front of the split plane, and left if I am behind it. When I eventually hit a leaf node, that is where I am in the world.
Now, in terms of rendering, if I had to render from front to back, would I start at the right side of the tree and render all the way recursively until I hit the last node on the left side. What about back to front? Would it be the opposite?
Thanks!
If you wanted to draw back to front which is the
Painters algorithm
you'd traverse left nodes first when you are in front, then render and then traverse right nodes.For front to back it would be the opposite.