The Utility is for use with any sketchfab object
I'm not creating any new functionality here. I'm simply abstracting the current usage of the Sketchfab API to be even more simple.
So you need to have the script imports in your header :
then in your body add some scripting with this one liner :
var sketchfabAPIUtility = new SketchfabAPIUtility('d23739a4aaef4dc483fec21c7bbf1dba', document.getElementById('api-frame'), onSketchfabUtilityReady);
Obviously the model number must be what you are wanting to display , and the iframe can be whatever you created it as
the last parameter is a call back to know when everything is ready. You will see this function in the example script , you can rename it if you like
That is it!
So what I have abstracted here is a whole heap of stuff happening to make it easier to setup and use the api.
I have attached my utility to this post for you
Just look in the two examples how I call to change colors , hide or show objects set alpha etc. This is still a work in progress and more functionality will be added going forward.
SketchfabAPIUtility.js (10.4 KB)