libacc
libacc copied to clipboard
Barycentric Coordinates of the closest point
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?
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): https://github.com/allo-/libacc/commit/eed352b8e673c3a6527f910fcde9045074762da9
- libeigen
#ifdef
s - 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.