f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Unable to zoom using `dolly` when it's orthographic

Open Nokse22 opened this issue 1 year ago • 2 comments

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

Nokse22 avatar May 20 '24 12:05 Nokse22

wdyt @Meakk ?

mwestphal avatar May 20 '24 15:05 mwestphal

for reference:

snoyer avatar May 20 '24 16:05 snoyer