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

Maintain distance while orbiting fast #18

Open
mozzius opened this issue Apr 18, 2022 · 6 comments
Open

Maintain distance while orbiting fast #18

mozzius opened this issue Apr 18, 2022 · 6 comments

Comments

@mozzius
Copy link

mozzius commented Apr 18, 2022

The orbit control example seems to bring the camera closer to the look-at point when rotating fast - presumably because it's taking the shortest path in 3D space. Would it be possible to maintain the distance from the centre when rotating?

@bonsairobo
Copy link
Owner

That should not happen. Orbit radius should stay constant, except for when smoothing happens, but I would expect that to eventually converge on a correct radius. I will try to reproduce this.

@mozzius
Copy link
Author

mozzius commented Apr 19, 2022

Thank you. I can produce a minimal reproduction if needed.

@bonsairobo
Copy link
Owner

Yea I'm not able to reproduce this in the simple_orbit example. Could you confirm that you can reproduce this on the simple_orbit example?

@mozzius
Copy link
Author

mozzius commented Apr 19, 2022

https://gfycat.com/briefelasticgermanwirehairedpointer

Here's a screen recording of the simple_orbit example

@bonsairobo
Copy link
Owner

I see. The radius constraint is only temporarily violated by the smoothing. This is because the smoothing happens in Cartesian coordinates in a controller-agnostic way.

If you want a smooth orbit camera that always maintains the radius constraint, I suppose you would need to only apply smoothing in polar coordinates, i.e. to the camera's angles, not it's position.

Perhaps we want some way to choose between different kinds of smoothing? Instead of just one Smoother component we could have a CartesianSmoother and a PolarSmoother. I think the PolarSmoother could even reuse the LookAngles code.

However there is also the case where the target moves. If only polar smoothing is applied here, then the translation of the translation might feel weird. Not sure.

@drHuangMHT
Copy link

same behavior when rotating fast.

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

No branches or pull requests

3 participants