aspect2d modified by Panda?

Hi,

In my program I’m using CardMakers to display some 2d images over the scene, and I’m adjusting aspect2d scale using:

aspect2d.setMat()

to achieve the desired results.

I noticed that between 2 calls to aspect2d.setMat(), its matrix had been changed!!! Is it possible that Panda changed it and in which circumstances? How do I get a chance to get warned in order to apply my own value?

I’m using Panda 1.7.0
This same issue doesn’t happen with Panda 1.6.2

Thanks
-David

ShowBase.windowEvent(), which is called whenever the window is resized (among other times), will by default reset the scale on aspect2d to reflect the new shape of the window.

If you would like to disable this automatic behavior, the easiest way is to put “aspect-ratio 1” in your Config.prc file (or any other explicit aspect ratio). Setting an explicit aspect ratio tells Panda not to auto-adjust the aspect ratio to match the actual shape of the window.

Edit: alternatively, parent your cards to render2d instead, which is unscaled (but don’t set the scale on render2d; set the scale on your cards).

David

If your setting the matrix of manually you can also try reparenting to render2d instead.

Thanks David,

I’m still flabbergasted by the promptness and accuracy of your answers.

That “aspect-ratio” trick in the config file solved my issue and thanks to that we can upgrade our middleware to Panda 1.7.0

By the way is it a new behaviour? Cause I didn’t face this issue in Panda 1.6.2

Regards
-David

No, it isn’t a new behavior. I don’t honestly know why you didn’t have the same problem in 1.6.2.

David