use actual aspect ratio

This commit is contained in:
Nick Fisher
2022-12-22 19:58:23 +08:00
parent 357b2b0b7c
commit 28dfe0d34e

View File

@@ -873,10 +873,10 @@ void FilamentViewer::updateViewportAndCameraProjection(
const double aspect = (double)width / height;
Camera& cam =_view->getCamera();
cam.setLensProjection(_cameraFocalLength, 1.0f, kNearPlane,
cam.setLensProjection(_cameraFocalLength, aspect, kNearPlane,
kFarPlane);
cam.setScaling({1.0 / aspect, 1.0});
// cam.setScaling({1.0 / aspect, 1.0});
Log("Set viewport to width: %d height: %d aspect %f scaleFactor : %f", width, height, aspect,
contentScaleFactor);