Web SDK Reference - Static views
A static view is a collection of camera-related settings that are defined in the product’s scene. Multiple static views can be defined in a product scene.
Static views make it easy to see the same product from different sides, with different camera settings or with a different background and foreground image. The methods below show how to get started with static views.
Static views are uniquely identifiable by their string name.
Method getViews
The method getViews()
returns a list of available static view names.
getViews(): string[]
Returns
Type | Description |
---|---|
| A list of available camera view names. |
Example usage
views = context.staticViews.getViews();
Method getImage
Calling the getImage()
method stores the current product configuration (i.e. parameter settings) on the Twikit server. An overview of all stored configurations can be viewed at https://configurations.twikit.com.
getImage(view: string, (dataUri: string) => void): void
Parameters
Name | Type | Description |
---|---|---|
view |
| The name of the static view. |
- |
| New parameter value to set. |
Example usage
views = context.staticViews.getViews()
context.staticViews.getImage(views[0], dataUri => {
img.src = dataUri;
});
Static views demo application
The demo application that was built with Twikit collaboration with Tarform and FormLabs shows a great use case of static views. The feature is used to toggle an experience view. Explore the demo and blog article using the links below: