Sketchfab Forum

Locking the camera


(Lagrangemtl) #1


I'm in the process of creating a product previewer and I wanted to know if it was possible to lock camera rotation, zoom or translation with the viewer API ?

If so how would I go about doing that ?

Thanks !

(Shaderbytes) #2

just cover the viewer iframe with a div , this will block all mouse interaction.

(Lagrangemtl) #3

Thanks for the help, I knew I could do that but what if I wanted to keep the rotation and deactivate the zoom ?


We hope to implement proper camera constraints in the future. I'll add your '+1' to this feature request.

It is sort of possible with the Viewer API, but you would need to poll the camera position continuously. I did a (related) quick and dirty demo here:


You can also use the scrollwheel=0 parameter to block zooming:

(Lagrangemtl) #6

Thanks a lot, that really helps !


We just launched a Camera Limits feature! I hope it's useful for you.