WPI-AIM / ambf

Asynchronous Multi-Body Framework
158 stars 64 forks source link

Issue with depth point cloud coordinates #139

Closed adnanmunawar closed 2 years ago

adnanmunawar commented 3 years ago

The equations need some correction.

nag92 commented 3 years ago

what is wrong with the point cloud?

adnanmunawar commented 3 years ago

The max-width and max-height calculation were wrong (swapped):

This is what it was before

maxX = 2.0 * cAbs(f) * cTanRad(fva/2.0);
maxY = maxX / ar;

f is Far Plane, and fva is the Field View Angle.

The fva measures the vertical frustum angle but the above equation was considering it as a horizontal frustum angle.

These should be correct equations as added via the commit.

maxY = 2.0 * cAbs(f) * cTanRad(fva/2.0);
maxX = maxY * ar;