-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Mesh picking - Barycentric coordinates not normalized #639
Comments
Hi Sebastian, You are quite right. The picking info is stored in a limited amount of memory, leaving just 6 bits for each of the coords, so the deviation from 1 is due to rounding errors. I agree that it would be good to normalize the values so that they add up to one again. That code is here: Lines 152 to 177 in f4687bc
Would you perhaps be interested in contributing a PR for that? |
Dear all,
the "face_coords" in the event.pick_info are not normalized (their sum does not equal 1). If one wants to use those coordinates to calculate the coordinates of a picked point on a triangle mesh in world coordinates, this leads to erroneous calculations. While it is not a big problem, as it's enough to divide by their sum, I somehow automatically assumed them to be normalized and it did cost me some time to realize that this might be the problem!
Is this an intended behavior? If so, then I would suggest adding this information somewhere in the documentation. Or is it already mentioned and I didn't find it?
Sebastian
The text was updated successfully, but these errors were encountered: