Closed xeolabs closed 3 years ago
If we translate the model, the pivot point is not centered anymore. Is it intended?
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.
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
Hi Lindsay! Do you want me to create an issue to talk about this?
Hi @Amoki , yes please
When
myViewer.cameraControl.navMode == "orbit"
and we click-drag on empty space, then orbit us aboutCamera#look
, instead of aboutScene#center
.This change helps the following navigation use case.
When
myViewer.cameraControl.navMode == "orbit"
, dollying movesCamera#eye
andCamera#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