Hacker News new | past | comments | ask | show | jobs | submit login

It 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.



That 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.


The 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 ? It shows how a BSP is built and traversed for rendering.


Interesting. Thanks for sharing. I think i need to dig into that article to try to understand this better.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: