Change the view while keeping the camera position

Hey all,

i’ve got a trouble with view in shapespark

every time we switch the view shapespark goes back to the original default position of that view
Can I change the view while keeping the camera position?

I don’t think it can be done with regular Shapespark operations, is it possible to solve the above problem with “Scripts”

Please help me !!!

Hi @Hung_Quoc_NGUYEN

Do you mean you would like to keep camera rotation when changing views? (so only camera placement is moved from point to point without affecting camera angles?)

If yes then it’s not possible with regular Shapespark functionality.

It might be possible to achieve with scripts, but it wouldn’t be straightforward.
Please take a look at our Viewer API for view related functionality (there is also example script and example scene): Here is direct link to the view switch section: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

By calling ‘Viewer.switchToView’ we can pass custom ‘viewObject’, that requires position and rotation. For the rotation we could pass current camera rotation. Here is direct link to the camera section: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

Best regards