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

Barycentric Coordinates of the closest point #7

Open
allo- opened this issue Aug 7, 2017 · 1 comment
Open

Barycentric Coordinates of the closest point #7

allo- opened this issue Aug 7, 2017 · 1 comment

Comments

@allo-
Copy link
Contributor

allo- commented Aug 7, 2017

I will need the barycentric coordinates of the hit point in closest_point. I think of creating some Hit like struct with triangle id, 3D point, barycentric point and possibly distance as well or maybe a pair<Vec3fType, Hit>. What type would you prefer and do I need to care about the API in the develop branch or is it not used, yet?

@allo-
Copy link
Contributor Author

allo- commented Aug 9, 2017

I implemented it with a new struct in primitive.h and in bvhtree.h.

I will soon push patches based on develop in my repo:

  • Bugfix for iterators (in MSVC): allo-@eed352b
  • libeigen #ifdefs
  • Hits with struct containing intersection point, index, distance and barycentric coordinates
  • (TODO): Templates for scalar type.

I do not know how easy it will be to cherry-pick / branch on the different things. For the first three I have a patched code which I will split into different commits, but the later ones probably won't apply without change, if you do not have the first ones.

Further I may look into returning the k nearest triangles. I am not sure how easy it will be, but I think about just merging the leafes in the higher nodes until k triangles are found.

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

1 participant