Fix swapped vertical frustum bounds for cameras with principal point offset.
The frustum_top and frustum_bottom assignments in mjv_updateCamera used the wrong elements of the zver array, causing the principal point cy offset to be applied with an inverted sign. This shifted the rendered image vertically by 2*cy pixels.
This commit is contained in:
@@ -2910,8 +2910,8 @@ void mjv_updateCamera(const mjModel* m, const mjData* d, mjvCamera* cam, mjvScen
|
||||
scn->camera[view].orthographic = orthographic;
|
||||
|
||||
// set symmetric frustum using intrinsic camera matrix
|
||||
scn->camera[view].frustum_top = zver[1];
|
||||
scn->camera[view].frustum_bottom = -zver[0];
|
||||
scn->camera[view].frustum_top = zver[0];
|
||||
scn->camera[view].frustum_bottom = -zver[1];
|
||||
scn->camera[view].frustum_center = (zhor[1] - zhor[0]) / 2;
|
||||
scn->camera[view].frustum_width = (zhor[1] + zhor[0]) / 2;
|
||||
scn->camera[view].frustum_near = zclip[0];
|
||||
|
||||
Reference in New Issue
Block a user