Progress has been rough. The traversal code for the KD-tree was trickier than I expected. First of all there I had to implement the algorithm from "An Efficient and Robust Ray–Box Intersection Algorithm" to quickly do box intersections. After that I realized that there are many different ways a ray can intersect with the nodes and each case must be hardcoded. Shown below is a helpful graphic I found. This helped me visualize some of the cases. They are all not present below.
After I thought I had every case covered, I attempted to render an image using my kd-tree.
Clearly, not all cases work as intended. The final image is supposed to be three spheres. As of now, I am in process of debugging them.


No comments:
Post a Comment