First person view

Thank you for seeking help! Our friendly community is here to assist you. :pray:

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

Hi @Muhammad_Adnan

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

Cheers

Thanks @alex
i want to prevent the camera from moving(translating) and only allow rotation. just like it happens in 360 images.

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.

Hi @Muhammad_Adnan

I see. And you are building your own app, or are you trying to use the speckle web app to achieve what you are describing?

so i have setup the speckle server and uploaded a model(ifc format) and now using @speckle-viewer in my react application.

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.

Let me know if you need further help

Cheers

Thanks @alex. example was very helpful. :+1: it covers my use case.

1 Like