By script changes view

Hello.

I need to change the view, when i started the escene automatically go to another view.(with the transition)

I try to do it for myself but i don’t know anything about scripts. I investigate and i need a “get camera” and “switch view”, or something like that. But i try to create the code and i can’t do.

I do this way Pointer for Teleporting - General - Shapespark Community
[https://link-to-my-scene/scene1/#view=room2]

But its not exactly that i need.

I have a lot of hours proof with this: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

With the “switchview”, but it’s hard invent the code.

Anybody can helpme?

Thanks for your valious time.

Are you aware of the Automatic tour/Start on scene load settings in the Viewer tab? Perhaps these would be suitable for you without custom code.

Yes, i try. But the tour don’t stop.
I want that the next camera stop the tour.
Thank you

This should work (you need to replace Floor plan with the name of the view to which you would like to go) :

 var viewer = WALK.getViewer();
 viewer.onSceneReadyToDisplay(function() {
   viewer.switchToView('Floor plan');
 });

It works!!!

Thank you
thank you
thank you