P is ray origin, D direction. How do I calculate tx, ty(s)? This is for octree raycast. The primary goal is to get 1st intersection voxel (v) then second (v") and so on.
Asked
Active
Viewed 614 times
0
-
See answer here. Closing as duplicate. – Engineer May 15 '21 at 17:48
-
Does this answer your question? fast 3d point -> cuboid volume intersection test – Engineer May 15 '21 at 17:49
-
@Engineer the answer points to a book and dead link for source code. Not really an answer. – Janis Taranda May 15 '21 at 17:51
-
Not a full answer either, but this video might help. https://www.youtube.com/watch?v=NbSee-XM7WA – Jonathan S. May 15 '21 at 18:12
-
This is probably the algorithm being referred to elsewhere. – DMGregory May 15 '21 at 19:12
-
I tried to take a different approach to explaining this here, perhaps that helps. – Theraot May 16 '21 at 01:30
-
All examples start inside of grid. What if origin is outside? – Janis Taranda May 16 '21 at 16:31
-
Either extend / redefine your grid to include the origin or find where the ray first intersects the grid & use that as your starting point. – Pikalek May 17 '21 at 02:05
-
Yes find where first intersects, but how? AABB test? – Janis Taranda May 17 '21 at 14:08
-
You can check for intersections against the four bounding segments of the grid (i.e. the bounding rectangle (xMin, yMin) (xMax, yMax)) By definition the XY axis grid is already axis aligned. – Pikalek May 18 '21 at 02:28