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

Gradual Transitions when resetting View #75

Open
MattFerraro opened this issue Jun 1, 2024 · 2 comments
Open

Gradual Transitions when resetting View #75

MattFerraro opened this issue Jun 1, 2024 · 2 comments
Labels
3D UI enhancement New feature or request good first issue Good for newcomers

Comments

@MattFerraro
Copy link
Collaborator

Currently you can reset the view in two ways:

  1. For any Plane in the history, hit the magnifying glass
  2. Use the Gizmo in the upper right corner to hit a plane

In both cases the view is reset, but it can be disorienting because it happens instantly. It would be much better if the effect was gradual, easing your viewport into the new location.

@MattFerraro MattFerraro added enhancement New feature or request good first issue Good for newcomers 3D UI labels Jun 1, 2024
@sebsebmc
Copy link
Contributor

sebsebmc commented Jun 26, 2024

I see that there were attempts to do this with gsap and camera-controls in the past, any reasons that those were removed or didn't work?

I see that Threlte has theater that is their recommended way of introducing animations, but feels potentially overkill if its just for camera easing.

@MattFerraro
Copy link
Collaborator Author

MattFerraro commented Jun 27, 2024

I was able to make the gsap version work in the past and I think that's a viable path. I removed it because I didn't know how to do the quaternion linear interpolation to get from wherever you were to the correct final orientation--I just linearly interpolated the camera position and angle directly. That works okay in some scenarios but leads to really weird visual effects in others. If you can figure out how to handle the quaternions properly, I think it's a good approach!

The attempts with camera-controls worked well but we no longer use camera-controls because camera-controls is completely built around an OrbitControl of the camera instead of a TrackballControl of the camera and there was no obvious way to change it. I wouldn't recommend going down that rabbit hole.

I agree theater is probably overkill, but I could be convinced otherwise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3D UI enhancement New feature or request good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

2 participants