Mayavi viewport changes slightly when enabling offscreen rendering
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
After a lot of effort I got the mayavi camera to point in the same direction as a rigid transformation I use to position my camera (different from mayavi camera) in a virtual scene. Then I use mayavi to generate screenshots that I insert in my virtual scene, so I can clearly see when the screenshots and the scene are correctly aligned as the camera moves. As I only need screenshots of the mayavi scene, I made the rendering offscreen to hide the mayavi window by setting:
`mlab.options.offscreen = True`
before I create the mayavi figure (as explained in [here](http://docs.enthought.com/mayavi/mayavi/tips.html#off-screen-rendering)).
At the first glance this seemed to work, but then I realised that the screenshots were slightly different, like if the field of view of the camera had decreased a little bit wrt. not using offscreen rendering. I've queried the view settings and nothing seems to have changed when I'm rendering offscreen.
The only thing I've found online that may remotely be related is [this ](http://vtk.1045678.n5.nabble.com/Offscreen-rendering-beyond-screen-resolution-with-WindowToImageFilter-magnification-td5724102.html) question, where the last answer argues that the border of the window seems to change something in the offscreen rendering. I tried the following:
```
mlab.options.offscreen = True
self.fig = mlab.figure(bgcolor=(1, 1, 1), fgcolor=(0, 0, 0), size=(w, h))
scene = self.fig.scene
cam = scene.camera
cam.view_angle = self.fov
ren = scene.renderer
win = ren._get_vtk_window()
win.borders = False
```
to try to switch off these borders, but the screenshots I get while in offscreen rendering are still different from non-offscreen renderings. Any idea what's going on?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.