Scrub animation by scrolling webpage


(Wakyak) #1

Hi!

What I would like to do is the following: tie the animation of a Sketchfab-model to where I happen to be on a given webpage, all the way up would be at the start of the animation, 50% down would be in the middle and so on.

Sort of like the Article Scroll in Lab experiments (https://labs.sketchfab.com/experiments/article-scroll/) but for model animation rather than camera moves.

I’ve got a handle on html and css, but I’m still learning Javascript. So just a friendly point in the right direction would be of great help.

Cheers /Erik


#2

Hi Erik,

We have animation functions in the Viewer API, so when the scroll event happens, you could run an animation instead of moving the camera. However, there’s not really an easy way to scrub. You would need to go to specific times/frames using the seekTo function.

https://sketchfab.com/developers/viewer/functions#api-section-animation