Closed lasselaakkonen-congrid closed 4 years ago
This bug is caused by pivoting math breaking for the case when we start pivoting while initially looking directly downwards.
I wasn't able to make the pivoting math robust for this case, however I was able to implement a UX workaround which is minimally disruptive.
As shown in the screenshot below, if we're not initially looking directly downwards, then we pivot about the position we click.
If however we are initially looking directly downwards, the first click and drag just orbits the camera about it's current point-of-interest. On a subsequent drag, since the camera is 99.99999% likely to no longer be looking directly downwards, we set the pivot point to the mouse position on the object surface, and pivot that as expected.
The UX compromise here is that if the user was planning to do a pivot about a clicked point right after selecting a downward-looking viewpoint (eg. using NavCube), then as they drag they'll notice they're not pivoting as expected, and are then likely to attempt to pick the pivot point again. Better than the model disappearing!
When
cameraControl.pivoting = true
, the canvas goes completely blank in some specific scenarios when rotating the view.The issue can be reproduced with NavCubePlugin or without NavCubePlugin by manually setting the same camera eye/look/up values as the NavCubePlugin sets.
Reproducing with NavCubePlugin
Using macOS Chrome v80.0 and xeokit-sdk v0.9.93.
Load a model like this:
Change to the Top view from the NavCube.
Try to rotate the model by clicking and dragging.
The canvas goes blank without anything in console logs.