pymadcad icon indicating copy to clipboard operation
pymadcad copied to clipboard

bad depth for the point retreived with `View.ptat`

Open jimy-byerley opened this issue 3 years ago • 0 comments

description

When using View.ptat() to get the 3d position on an object of the screen, the point is well placed on the screen from the point of view of the camera, but doest have the correct depth, resulting in a point much farther the pointed surface. This issue is more described in #28

current resolution state

For the implementation of ptat I relied on the OpenGL internal depthmap to get the view-object distance, and then recover the 3d position with the view perspective informations. But for some reasons OpenGL is giving me incorrect values (not conform to what the specifications I read says). So I experimentally patched the wrong depth value with a factor 0.53 which was giving something precise at ~5% at the time. Recently I noticed 0.5 was much closer to the reality, which was not the case at the time.

jimy-byerley avatar Mar 20 '22 09:03 jimy-byerley