Renderer's `resetCamera()` is biased to height when calculating zoom
See original GitHub issueI’ve noticed that there is a render bias for fitting the bounds in the render viewport when using renderer.resetCamera(). Note that these examples are with Parallel enabled, but I can try to reproduce with normal perspective as well.
Example:
Wide viewport scales to fit:
VS
Narrow viewport crops significantly

Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Calculate camera zoom required for object to fit in screen height
How do I calculate the camera zoom required for object to fit exactly into render area by HEIGHT? Thanks to GuyGood, I found...
Read more >vedo.plotter API documentation
Module vedo.plotter. This module defines the main class Plotter to manage actors and 3D rendering. Expand source code
Read more >Source code for pyvista.plotting.renderer
Source code for pyvista.plotting.renderer. """Module containing pyvista implementation of vtkRenderer.""" import collections.abc ...
Read more >The VTK-m User's Guide - INFO
10.1 Example output of VTK-m's rendering system. ... 10.20 Zoom the view based on mouse movements. ... GetCoordinateSystem(), outData.
Read more >User Guide :: Nsight Graphics Documentation
When debugging a rendering problem, Nsight Graphics's Frame Debugger is the ... Consider transforming a lookup table into a calculation.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I would recommend adopting the c++ logic that calculates the viewport ratio and fits to the smaller dimension, by default.
Manual COULD be nice, but the goal of reset is “fit the content in the viewport”, and should be ratio agnostic.
As a developer, I shouldn’t have to manually track what the viewport ratio is.
C++ implementation takes into account aspect ratio: https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/Core/vtkRenderer.cxx#L1138-1157
Interestingly, it used to be possible (though bugged?) to choose wether sphere is fit horizontally or vertically: https://github.com/Kitware/vtk-js/commit/b9956c73cd51947edcd36234c03818802209df9a
Best is to ask original author: @martinken WDYT ?