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

CameraControl tweak - orbit Camera#look when click-dragging on empty canvas in "orbit" mode #503

Closed
xeolabs opened this issue Dec 19, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@xeolabs
Copy link
Member

xeolabs commented Dec 19, 2020

When myViewer.cameraControl.navMode == "orbit" and we click-drag on empty space, then orbit us about Camera#look, instead of about Scene#center.

This change helps the following navigation use case.

When myViewer.cameraControl.navMode == "orbit", dollying moves Camera#eye and Camera#look forwards and backwards, in unison. Dollying is therefore able to move us all the way through a model, and then out the other side.

If we dolly through a model and pop out the other side, then being able to click and drag on the empty space in front of us, to orbit us about Camera#look, will allow us to turn around and face the model again.

The previous behaviour for click-dragging empty canvas, in which we orbit Scene#center by default, would be disorienting, because that center could be anywhere, resulting in objects whizzing past and disappearing as we orbit.

Demo: https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_XKT_DoublePrecision_MAP

@xeolabs xeolabs added this to the 1.5.3 milestone Dec 19, 2020
@xeolabs xeolabs self-assigned this Dec 19, 2020
@xeolabs xeolabs added the enhancement New feature or request label Dec 19, 2020
@xeolabs xeolabs closed this as completed Dec 19, 2020
@Amoki
Copy link
Contributor

Amoki commented Dec 22, 2020

If we translate the model, the pivot point is not centered anymore. Is it intended?
output

We're also thinking of something else. Currently, the user shouldn't click outside the model. We're trying not to lose users when they do this rather than providing a smart behavior when clicking outside the model.

pivot

We draw a virtual sphere between the center of the model and the camera.
If the user clicks on the model, the pivot point is where they clicked (the current behavior). (2.)
If the user clicks outside the model, the intersection between the ray and the sphere is used as the pivot point. If we click outside the model on the right, the behavior is different if we click outside the model on the left. (1.)

There are many variants we'd like to try (eg: same with the AABB diagonal as the sphere diameter).
Unfortunately, we're not able to test our ideas because of our lack of math.

What do you think? A live coding session to try stuff may be interesting too

@Amoki
Copy link
Contributor

Amoki commented Jan 12, 2021

Hi Lindsay!
Do you want me to create an issue to talk about this?

@xeolabs
Copy link
Member Author

xeolabs commented Jan 12, 2021

Hi @Amoki , yes please

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

No branches or pull requests

2 participants