Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to implement intersection on AABB for testing if cluster is in viewport? #90

Open
AnachronicNomad opened this issue Apr 20, 2022 · 1 comment

Comments

@AnachronicNomad
Copy link

Hello! I'm using an R*-Tree to hold 3D graphical data, organized as points. I'm trying to figure out how I could determine whether the AABB for a given leaf node in the tree is within view of a camera.

One way I've thought of to define the view would be to approximate the camera view as a Cone, with a central axis along the camera's view direction and sufficient radius to match up with the camera's FOV. However, I can't tell from the documentation how I might implement a Cone geometry as an AABB Envelope in order to perform intersection tests on the R*-Tree data structure.

Another thought that came to mind would be trying ray-based intersections across the tree. However, I don't know how I would approximate the camera's view with so many rays to do intersection tests, using this library.

Does anybody have any thoughts or suggestions?
Thanks so much in advance for any insights!

@rmanoka
Copy link
Contributor

rmanoka commented Apr 22, 2022

An AABB for a Cone can be constructed if you know the height of the cone; that is a max-distance from the view-port to the points. I'm not sure if it is the most optimal method though.

Another option is to construct a function: Cone::is_intersecting_aabb(aabb: AABB) -> bool that tells if the given cone object is viewing any part of a input aabb. Then, you can implement trait SelectionFunction which will then let you efficiently traverse only the points that are inside the cone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants