sketchfab viewer api 1.5 blog header

Viewer API 1.5 & New Interactive Demos

Back to overview

Viewer API version 1.5 is here! It adds several new features, as well as a fancy new demo section in our documentation. You can view examples of common 3D configurator use cases and edit the code in real time. For example, you can swap out a model UID to test the same demo with your own model. Additionally, you can fork the example code to JSFiddle or CodePen in a single click to continue working on it later.

sketchfab viewer api examples overview

New in 1.5

Changes in 1.5

  • addVideoTexture now includes a muted parameter. This allows the video to autoplay by default without being blocked by browsers’ audio policy that require user interaction to play audio.
  • gotoAnnotation now includes a preventCameraMove parameter. This allows you to open an annotation without moving the camera to its position.
  • Added one to setCycleMode, which will play the current animation once and stop.

Examples

Some of these use the new features of 1.5, while others are just frequently discussed applications that we now have demos for.

Custom Annotation Style

This works by loading a custom SVG image which is a grid of icons that acts as a texture for the 3D annotations. See it in action on the examples page.

sketchfab viewer api example custom annotation

Localized Annotation Text

This works by updating annotation titles and text on the fly. You could allow your users to switch languages in real time, perhaps as a teaching aid, or load a specific language automatically based on a visitor’s site settings or location. See it in action on the examples page.

Update Texture

This works by writing to an HTML <canvas> element and using it as a texture on the model. As a result, you can do things like animate textures, insert images, and allow user text input. See it in action on the examples page.

sketchfab viewer api example update texture

Conclusion & Up Next

Version 1.5 of the Viewer API includes several new features, new events, and new parameters for existing functions. There are lots of new demos to discover in the documentation, and we’ll be adding more over time.

We have some fixes and small documentation updates coming soon, and we’re actively scoping features and improvements for version 1.6. If there’s something YOU would love to see in a future version of the Viewer API, don’t hesitate to join the Sketchfab API Developers Community and also start a discussion on our Developer Forum! You can also subscribe to updates from the Viewer API Change Log.

About the author

Avatar

James Green

Sketchfab Product Specialist & Support King | Beer Enthusiast | Pokémon Master


Leave a Reply

Your email address will not be published. Required fields are marked *

    Related articles