Thank you for seeking help! Our friendly community is here to assist you.
To assist you better, please consider providing:
Objective: First person view in speckle viewer
Issue: I want to implement first person view in speckle. i.e camera stays at same position while the view/model moves around. currently camera position is also changing. weird thing is at some points it actually stays still. but i move around lets say zoom out and zoom in again and try panning again camera starts to move.
Example: same behavior is reproducible on default models when we sign up
We’re always happy to hear that members of the community are willing to contribute to the project! We will bring firsts person view in the near future to speckle, but in the meantime feel free to implement your own as you see fit!
I’m afraid I don’t understand very well what you mean by the current camera staying still,but let me know if I can be of further help with this
for context, we want to compare 360 image and model side by side, now in a 360 image camera remains still while we pan around in an image, and we want to acheive the same behaviour in model as well.
There is way to simulate what you need. I’ve made a live example for you.
The camera controller is still an orbit type camera controller, however, we set the orbit origin very close to the camera’s position. This effectively makes the camera rotate ‘around itself’, eliminating any translation when rotating. The end result is similar to panning inside a 360 image.
I’ve also disabled zooming and panning by cameraController.options = { enableZoom: false, enablePan: false }; so that the camera remains still even if you try to zoom or pan. This is optional of course.
Please note that I’ve used the latest @speckle/viewer version as it contains some important changes regarding the basis in which the camera controller API defines it’s input/output vectors.