Set camera origin at top-left of the first pixel.

PiperOrigin-RevId: 564768176
Change-Id: Ieef632f0f6888390acca91b6de01c8951c747fe4
This commit is contained in:
Alessio Quaglino
2023-09-12 10:43:59 -07:00
committed by Copybara-Service
parent 8064ad59c8
commit b0abafe3bb
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -225,8 +225,8 @@ static void cam_project(mjtNum sensordata[2], const mjtNum target_xpos[3],
image[0][0] = 1;
image[1][1] = 1;
image[2][2] = 1;
image[0][2] = ((mjtNum)cam_res[0] - 1) / 2.0;
image[1][2] = ((mjtNum)cam_res[1] - 1) / 2.0;
image[0][2] = (mjtNum)cam_res[0] / 2.0;
image[1][2] = (mjtNum)cam_res[1] / 2.0;
// projection matrix (3x4): product of all 4 matrices
mjtNum proj[3][4] = {0};