Navigate through scenes

Has somebody come across with a way to navigate through scenes in a “next” “previous” fashion?

The switchToView and onViewSwitchDone functions described here: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene. should allow you to do it. A generic idea could be to keep a list of view names in JavaScript code, remember which view was last activated when a onViewSwitchDone is called, and activate the previous or the next view to this last activated view when a custom ‘next’ ‘previous’ buttons are clicked.

The example linked from this API document could be used as a staring point: 3D scene
shapespark-viewer-api/body-end.html at master · shapespark/shapespark-viewer-api · GitHub

Hey @jan,

Thanks for the reply, I undestand your explanation…I was surfing through the walk.js and thought that maybe I could use switchToAdjacentView or so I dont remember exactly…and using an array composed of my views should do the work.
One last thing, I am just getting used to html, css and javascript, and I know is not your scope to help us out with customization but if you could help me out this time with a script for the tour button we have on the right bottom corner…because I already have my custom buttons but I’m struggling with the code. If you help me out with this then I can surely figure it out for the prev/next button.
Thanks.

Auto tour is not exposed via API, so you would need to try styling the existing button (it has an id ‘tour-button’), or implement own auto tour using switchToView API function.

1 Like

hey, great hint…the id button, thanks @jan!