Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QoL: Add auto perspective #8312

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Noisyfox
Copy link
Collaborator

@Noisyfox Noisyfox commented Feb 4, 2025

This PR introduces auto perspective that works similar to Blender:

  • When click the top/bottom/left/right/front/back on the 3D navigator, or switch to those view from the menu, or by shortcuts (Ctrl+1-6), the camera automatically switch to orthogonal view
  • When switch to any other angles, either by dragging with mouse/track pad, or by clicking other non-perpendicular faces on 3D navigator, or select default view from menu/short cut (Ctrl+0), the camera automatically switch to perspective view
  • Panning and scalling won't trigger the view change
  • This is optional and disabled by default, you can enable this from the view menu
    image

This PR also fixes a few issues with 3D navigator:

  • When click top/bottom view, sometimes the orientation is wrong. Now the orientation is always the same as if you select the top/bottom view from the view menu or by the shortcut.
  • When dragging the 3d navigator vertically, once the vertical limit is reached and you keep dragging it, the view will keep fliping diagonally (gimbal lock, techenically). This issue is illustrated as below, and has been fixed in this PR and the orientation is stable. flipping

Fix #7848

@discip
Copy link
Contributor

discip commented Feb 4, 2025

Great! 😃👍

Again a much appreciated QoL addition! 🚀

Thank you so much for all the fixes and improvements! ❤

@yw4z
Copy link
Contributor

yw4z commented Feb 16, 2025

Nice work on navigator. FYI there is a small glitch when using corners one after another. you can see few times appearing on first half of video

orca-slicer_U0eRqjqopU.mp4

i thought auto perspective was changing field of view (FOV) depends on total area for plates

here is orthographic view
Screenshot-20250217001012

here is perspective looks too much. i thing there should be equation like zoom_amount / FOV = 1 . perspective also should reduce while zoom out
Screenshot-20250217001030

@Noisyfox
Copy link
Collaborator Author

FYI there is a small glitch when using corners one after another.

That might because the cursor get moved a little bit right after clicking the corner, which will stop the animation. Shouldn't be a huge problem though.

@Noisyfox
Copy link
Collaborator Author

i thought auto perspective was changing field of view (FOV) depends on total area for plates

It should behave the same as changing perspective from the view menu manually.

@yw4z
Copy link
Contributor

yw4z commented Feb 18, 2025

do yo have any plans to reducing fov. that looks too exaggerated. offtopic but also objects disappears from viewport if i move a bit further from bed

@Noisyfox
Copy link
Collaborator Author

do yo have any plans to reducing fov. that looks too exaggerated. offtopic but also objects disappears from viewport if i move a bit further from bed

I'll raise a separate PR for fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Setting: Automatically switch to orthographic mode when using sideview
3 participants