Hello from across the Mon River CMU ETC,
I am working on switching a virtual reality program for my research from Java3D to Panda3D+Python. We use a Dimension Technologies 3D monitor which converts side-by-side stereo into a 3D display. However, the two frames for the side-by-side stereo needs to be squished horizontally to half the final displayed width. I’ve been using the config “side-by-side-stereo 1” setting and adjusting to base.camLens FOV, but those settings do not match up at all with the geometries in the stereo display region.
Also, for the research project, the monitor needs to be viewed through a mirror. So I am looking for a way to flip the displayed Y axis. I have tried base.camLens.setViewMath(Mat4.scaleMat(1,-1,1)) but that seems to mess up the normals of the rendered geometries.
Hi, welcome to the forums!
You can flip the screen by simply inverting your DisplayRegion coordinates. On your main display region, you can do:
dr.setDimensions(0, 1, 1, 0)
Instead of the usual (0, 1, 0, 1). This will flip it in the vertical direction.
Alternatively, you can call base.win.setInverted(True), which seems to do what you want as well.
Cool - thanks, the setInverted did the trick. Still working to understand the fields of view for the stereo display region. Also, I’m not sure it’s a bug or something I am doing wrong but when I run
from direct.showbase.ShowBase import ShowBase
W = World()
it shows that there are 3 active display regions and 4 total regions.
Just an update for those having similar issues in the future. The creation of the multiple display regions is normal and associated with the different cameras/lenses. Ex the 2D camera for render2d, or the left/right lenses for stereo.
As for getting the aspect ratio to squeeze along the horizontal, I kept getting things overwritten when setting various combinations of the lens’ FOV, aspect ratio, film size. The way that finally ended up working for me was changing the showbase.setAspectRatio() to the ratio it should have in the squeezed state and changing the camera lens horizontal and vertical fields of view to the desired values (which have the presqueezed ratio).