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

Improve CameraControl dollying through objects #469

Closed
xeolabs opened this issue Nov 12, 2020 · 3 comments
Closed

Improve CameraControl dollying through objects #469

xeolabs opened this issue Nov 12, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@xeolabs
Copy link
Member

xeolabs commented Nov 12, 2020

With CameraControl followPointer set true, it can be hard to dolly through objects with the mouse scroll wheel, and takes a strong push on the wheel to break through.

CameraControl is designed to slow down as we approach an object, but is slowing down too much.

This can be fixed by ensuring that dollying speed in this case does not fall below a given minimum.

Solution

Increase the default value for CameraControl#dollyMinSpeed from 0.01 to 0.06.

If this is not enough, it can be increased further, eg:

viewer.cameraControl.dollyMinSpeed = 0.08;

Experiment with that here:
https://xeokit.github.io/xeokit-sdk/examples/#CameraControl_orbit_Duplex

@xeolabs xeolabs added bug Something isn't working BIMSpot labels Nov 12, 2020
@xeolabs xeolabs added this to the 1.5.1 milestone Nov 12, 2020
@xeolabs xeolabs self-assigned this Nov 12, 2020
@xeolabs xeolabs removed the BIMSpot label Nov 12, 2020
@xeolabs xeolabs closed this as completed Nov 13, 2020
@xeolabs xeolabs changed the title CameraControl in followPointer mode has difficulty dollying through some objects Improve CameraControl dollying through objects Nov 13, 2020
@eriadam
Copy link

eriadam commented Nov 13, 2020

@xeolabs Thanks for the fix attempt.

Would you have any additional information on what this value would be dependent on? Browser, viewport size, js engine, hardware, model size, number of meshes, so forth?

In other words, how to do we make sure it works for every models we render?

@xeolabs
Copy link
Member Author

xeolabs commented Nov 13, 2020

I'm not sure yet how to dynamically derive a workable value for this yet. It's possible, just needs thinking.

For now, I would just try to find a general magic value that works for all models, then I'll come back to this for the next release.

@xeolabs
Copy link
Member Author

xeolabs commented Nov 13, 2020

@eriadam this one's going to need more work. I just found a wall it gets stuck on, so will have a second patch for this in 1.5.2 on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants