From 28dfe0d34ef86f1e3727dbcb359e1d07a0c1a593 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Thu, 22 Dec 2022 19:58:23 +0800 Subject: [PATCH] use actual aspect ratio --- ios/src/FilamentViewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/src/FilamentViewer.cpp b/ios/src/FilamentViewer.cpp index 1258c0a8..3bc00517 100644 --- a/ios/src/FilamentViewer.cpp +++ b/ios/src/FilamentViewer.cpp @@ -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);