Search code examples
algorithmgraphicsraytracing

K-D tree for ray tracing in a rotating scene


If I want to ray trace a scene using a K-D tree, and this scene happens to rotate every certain time, is it necessary to rebuild the K-D tree for each rotation or something?


Solution

  • The short answer is yes.

    The better answer is no, not if you rotate your view matrix instead of the scene. You should translate your camera (rays) into the scene, not the other way around.