sensics / OSVR-RenderManager

Apache License 2.0
64 stars 45 forks source link

Change the specification of the center of projection (COP) from D-spa… #319

Closed russell-taylor closed 7 years ago

russell-taylor commented 7 years ago

…ce units in scaled distortion space to unit coordinates in screen space.

This makes the COP for purposes of projection consistent with the distortion and does the required math inside the library rather than in the config-file generation code.

russell-taylor commented 7 years ago

This will fix a disconnect between the center of projection for determining the projection matrix and the one used for distortion correction in the case where the D factors are other than 1 in radially-symmetric distortion correction.

russell-taylor commented 7 years ago

The original COP fields in the display configuration describe where the eye is w.r.t. the center of the screen and were in normalized screen coordinates. The radially-symmetric distortion correction code re-used these to also specify the center of distortion, but it did so (incorrectly) in D-scaled space. This patch corrects that incorrect overuse by leaving the COP in normalized screen coordinates. The way it is now, changing them to D space breaks the projection matrix, which expects them to be in normalized space. The documentation is being modified to be consistent with the correct behavior.

russell-taylor commented 7 years ago

Is more of an explanation needed?

rpavlik commented 7 years ago

This makes sense following our discussion yesterday. We'll probably need a separate center of distortion as well, as we discussed, possibly for each viewport, and presumably in normalized screen coordinates as well.