We just released Sketchfab Viewer API version 1.6 and version 1.7 in quick succession, so I’m combining them into a single release announcement.
What is the Viewer API?
The Viewer API lets you build web apps on top of Sketchfab’s 3D viewer. With the API, you can control the viewer in JavaScript. It provides functions for moving the camera, manipulating materials, and more.
1.6 & 1.7 Changelog
These versions include a ton of new API methods, events, and parameters to create highly customizable experiences involving annotations and camera limits. We’ve also added functions to transform UV maps, as well as highlight materials with an outline color.
Version 1.6 focused on improving applications with annotations and camera limits. Version 1.7 added UV transformations (Offset, Rotation, and Scale) and a plug-and-play “material highlighting” tool.
There are a lot of technical and specific changes. Instead of posting them all here, I encourage you to check out the official changelog, here.
Examples
Custom Annotation Experience
With a combination of new functions, events, and URL parameters, you can create a truly customized annotation experience. You can also combine annotations with camera limits, which is currently impossible in the regular viewer. Notice how there are multiple sets of camera constraints, one for the front of the phone and one for the back. Additionally, notice that both the annotation numbers and the tooltips can be customized in style. This works by replacing the regular annotation numbers with your own image, then keeping the “native” tooltips hidden while displaying your own. That gives you full creative control over the style and position of the HTML content, while still taking advantage of the speed and 3D precision of the viewer’s native annotation spots. See it in action on the examples page.
UV Transformations
These new functions let you to scale, offset, and rotate UV coordinates. This is a common feature of 3D modeling software, but Sketchfab does not support it in the 3D editor or during 3D model processing. However, now you can do it in real time with the Viewer API! You could use it to create animated textures by offsetting through a texture atlas (I imagine character sprite sheets or a television screen). It is also now possible to use the same image on multiple materials at different scales or orientations. See it in action on the examples page.
Up Next
We target a Viewer API release roughly once per quarter. If you have any need for new features or ideas for new examples, please let us know! We’ll try to work them into version 1.8 or beyond!
Interested in staying up-to-date with even more Sketchfab developer news? You can join the Sketchfab API Developer Community to receive a newsletter on API changes and case studies. Also, don’t hesitate to join or start a discussion on our Developer Forum! You can also subscribe to updates from the Viewer API Changelog.