question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Renderer's `resetCamera()` is biased to height when calculating zoom

See original GitHub issue

I’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: image VS Narrow viewport crops significantly image

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mix3dcommented, Apr 23, 2021

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.

1reaction
finetjulcommented, Jun 18, 2020

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 ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found