fix aspect

This commit is contained in:
Nick Fisher
2023-08-08 13:05:08 +08:00
parent 4ec9dbe756
commit 3e982e2993
4 changed files with 81 additions and 54 deletions

View File

@@ -830,10 +830,10 @@ void FilamentViewer::updateViewportAndCameraProjection(
const double aspect = (double)width / height;
Camera& cam =_view->getCamera();
cam.setLensProjection(_cameraFocalLength, aspect, kNearPlane,
cam.setLensProjection(_cameraFocalLength, 1.0f, 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);