Thousands of rays intersect with triangles in three-dimensional space.

There are thousands of rays and triangles. We need to get all the intersection points. If we use ordinary two-level loops, we need O (mn) time complexity. Is there a way to reduce the time complexity of fronm O (mn) to O (m * logn) or O (logm * n)?

Regards,

+3
source share
6 answers

What you probably want to see is some kind of space sharing technique. This allows you to quickly exclude collections of triangles.

, , , . , , - BSP ( ) /KD Trees Octree

+8

. : O (m * n). - O (n * m).

+2

- KD . , ; , .

, , , , .

+2

2D SweepLine. , 3D.

0

. : , , , .

0

Obviously, if you have to iterate and calculate the intersection between the ray and each triangle, then the complexity is O (mn). However, if you are only interested in triangles that can potentially intersect with a certain ray, you can try a variant of the space splitting grid, for example, a hierarchical quadrant grid ( http://graphics.stanford.edu/courses/cs468-06-fall/Slides/ steve.pdf ).

0
source

Source: https://habr.com/ru/post/1726431/


All Articles