Aspect Ratio of openWindow()


For the main window, panda automatically adjust the display region and aspect ratio of a window that changes size. Now I tried to open a new window with

base.openWindow(props=winProps, keepCamera=True, requireWindow=True)

and when i changes the window size of the new window, the aspect ratio does change, and when i changes the main window, the aspect ratio of the new window follows the main window. Is there a solution for the two windows both listen to respective window size changes?

ok. so i have found a solution -

set keepCamera to false and makeCamera to True in open window.
copy the code from showBase for adjusting the window aspect ratio to new window. = base.openWindow(props=wp, keepCamera=False, makeCamera=True, requireWindow=True) = base.camList[1]

def windowEvent(self, win): # for adjusting aspect ratio of lens in patient window
   if win !=
        return  # not about our window
   aspect = base.getAspectRatio(win)

self.accept('window-event', self.windowEvent)

Yes, you need a new camera to do this, essentially, because a camera lens can have only one aspect ratio. If you share the samecamera between windows with different sizes, it can’t have two aspect ratios at once.