mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
make aspect ratio match screen, not window
This commit is contained in:
parent
10694d29a1
commit
c8e33d3205
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user