f3d
f3d copied to clipboard
Unable to zoom using `dolly` when it's orthographic
Is your feature request related to a problem? Please describe. When it's in perspective I zoom using dolly, so moving the camera closer, but when it's orthographic it's not possible to zoom.
Describe the solution you'd like
- A generic function to zoom, that handles both orthographic and perspective
- Exposing VtkCamera.SetParallelScale to change the zoom in orthographic. This is what it's done in the app here
- A function only to zoom when orthographic similar to the other functions where you only pass the delta and not the final value
- Recompute the parallel scale internally when Dolly(), SetPosition(), and SetFocalPoint() are called if the camera is orthographic (and any other methods that affect the position-focal distance), this would not change the API
Also a function to be able to save the settings without rendering would be possible, because it would let me change to perspective, save, dolly and change back. Now it needs to render to be able to save.
Additional context This is what I have done to make it work: https://github.com/Nokse22/Exhibit/blob/3f6b2118d0365da4eeab1e8cc87d760cb5c54dbd/src/window.py#L190-L194
wdyt @Meakk ?
for reference:
-
vtkCameras zoom method changes the view angle in perspective mode and the parallel scale in parallel mode -
vtkInteractorStyleTrackballCamera's dolly medhod moves the camera in perspective mode and changes the parallel scale in parallel mode - in F3D there's a heuristic (copied from somewhere in VTK) to match the distance and the parallel scale when changing modes