3 ms·
One thing confuses me about this: does it require a separate tree per-axis?
by jamestimmins 4y ago
One thing confuses me about this: does it require a separate tree per-axis?
- gary_0 4y agoIt doesn't split by axis, it splits by planes that can be oriented however. Planes split a space into 2 half-spaces, hence the "binary" part. Only the older Wolfenstein-style rendering cared about the axis.
- jamestimmins 4y agoThat makes sense if I think about everything existing on a single axis (objects in front of each other on the z-axis). But if you then turn 90 degrees, then suddenly a bunch of those z-axis items are side by side, and order is based on the x-axis of my original perspective. So I don't understand how a binary structure accounts for that perspective shift. Edit: For clarification, my understanding is that there's a single tree built per-level in advance. If I'm mistaken and it's re-building the tree 30 times per second, the lack of axis concerns makes sense, but the article seemed to indicate that that's computationally prohibitive.
- gary_0 4y agoThe tree is built once. The tree can be traversed from any point in the world because each node stores which plane it used to split, and it is easy to compute which side of the plane you are viewing. Have you tried reading https://en.wikipedia.org/wiki/Binary_space_partitioning https://en.wikipedia.org/wiki/Binary_space_partitioning ? It shows how a BSP is built and traversed for rendering.
- jamestimmins 4y agoInteresting. Thanks for sharing. I think i need to dig into that article to try to understand this better.