From c8e33d320563abfd1784789030d5d3aaa2ca68e0 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 20 Nov 2001 23:37:50 +0000 Subject: [PATCH] make aspect ratio match screen, not window --- direct/src/showbase/ShowBase.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index f7bf2c90b2..103d4f50a2 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -130,6 +130,11 @@ class ShowBase: self.aspect2d = self.render2d.attachNewNode(PGTop("aspect2d")) self.aspect2d.setScale(1.0 / self.aspectRatio, 1.0, 1.0) + # And let's enforce that aspect ratio on the camera. + hfov = self.camNode.getHfov() + vfov = hfov / self.aspectRatio + self.camNode.setFov(hfov, vfov) + # It's important to know the bounds of the aspect2d screen. self.a2dTop = 1.0 self.a2dBottom = -1.0