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

Gimbal lock can be bypassed #1737

Open
Amoki opened this issue Nov 18, 2024 · 3 comments
Open

Gimbal lock can be bypassed #1737

Amoki opened this issue Nov 18, 2024 · 3 comments

Comments

@Amoki
Copy link
Contributor

Amoki commented Nov 18, 2024

Is this bug fix critical for your commercial enterprise?
No

Describe the bug
The user can rotate the model upside down

To Reproduce
Steps to reproduce the behavior:
Load a model
Pivot to see the roof until you can't go further
Release the pivot
Start a new pivot and you can go beyond and make the model do frontflips.
Side effect: If you release the pivot with model upside down, the next pivot will force it to stand on the feet, making a 180° instantly.

Expected behavior
User can't rotate the model upside down

Screenshots

Screencast.from.2024-11-18.16-00-10.mp4

(I can manage to record my cursor, hope it's clear enough)

@paireks
Copy link
Member

paireks commented Nov 18, 2024

Hey @Amoki do you know if it's a regression or is it something that was always there?

@Amoki
Copy link
Contributor Author

Amoki commented Nov 19, 2024

I just tried an old build, and it was already there 2 years ago

@paireks
Copy link
Member

paireks commented Nov 23, 2024

I tried to figure it out, and it looks like when you're looking exactly from the top it triggers different mode of rotation, which is this one:
https://github.com/xeokit/xeokit-sdk/blob/master/src/viewer/scene/CameraControl/lib/CameraUpdater.js#L126
and this specific rotation mode doesn't have a limitation of rotation, so you can do frontflips :)
I'm not sure how to limit this mode though to block frontflips. But at the same time I couldn't really find it problematic, that I can make these frontlips in this corner case (subjective opinion).
Historically it looks like this corner case exists, because rotation where we're looking exactly from the top makes the model disappear (if we try to treat it the same way as other roations). Related to: #289
This issue might be related to this one: #1020

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

2 participants