Low-level 3D Rendering Functions
setTranslation
Sets the 3D position (translation) of a widget in the scene. This function is supported for the following widgets: Model, Model Items, 3D Image, 3D Gauge, and 3D Label, and some tracker widgets.
Name
Type
Description
Required/Optional
name
String
Studio ID of the widget to position
Required
x
Number
X coordinate in 3D space (in meters).
Required
y
Number
Y coordinate in 3D space (in meters).
Required
z
Number
Z coordinate in 3D space (in meters).
Required
successCallback
Function
Called when the operation completes successfully.
Optional
errorCallback
Function
Called when the operation fails.
Optional
setRotation
Sets the 3D rotation of a widget using Euler angles in degrees. This function is supported for the following widgets: Model, Model Items, 3D Image, 3D Gauge, and 3D Label, and some tracker widgets.
Name
Type
Description
Required/Optional
name
String
Studio ID of the widget to rotate.
Required
x
Number
Rotation around the X axis (in degrees).
Required
y
Number
Rotation around the Y axis (in degrees).
Required
z
Number
Rotation around the Z axis (in degrees).
Required
successCallback
Function
Called when the operation completes successfully.
Optional
errorCallback
Function
Called when the operation fails.
Optional
setScale
Sets the scale of a widget in 3D space. This function is supported for the following widgets: Model, Model Items, 3D Image, 3D Gauge, and 3D Label, and some tracker widgets.
Name
Type
Description
Required/Optional
name
String
Studio ID of the widget to scale.
Required
x
Number
Scale factor along the X axis.
Required
y
Number
Scale factor along the Y axis.
Required
z
Number
Scale factor along the Z axis.
Required
successCallback
Function
Called when the operation completes successfully.
Optional
errorCallback
Function
Called when the operation fails.
Optional
* 
Use this function to uniformly or non-uniformly scale objects in the scene.
transform
Name
Type
Description
Required/Optional
name
String
Studio ID of the widget to transform.
Required
dx
Number
X position in 3D space (in meters).
Required
dy
Number
Y position in 3D space (in meters).
Required
dz
Number
Z position in 3D space (in meters).
Required
drx
Number
Rotation around the X axis (in degrees).
Required
dry
Number
Rotation around the Y axis (in degrees).
Required
drz
Number
Rotation around the Z axis (in degrees).
Required
successCallback
Function
Called when the operation completes successfully.
Optional
errorCallback
Function
Called when the operation fails.
Optional
* 
This function is equivalent to calling setTranslation and setRotation in one step.
setTexture
Sets or updates the texture of a widget. The texture source can be a remote URL or a base64-encoded image string.
Name
Type
Description
Required/Optional
name
String
Studio ID of the element to which the texture will be applied.
Required
texture
String
URI or base64-encoded image string. If omitted, any existing texture will be removed from the widget.
Required
successCallback
Function
Called when the operation completes successfully.
Optional
errorCallback
Function
Called when the operation fails.
Optional
* 
Textures can be applied to the following widgets: Model, 3D Image, 3D Gauge, and 3D Label.
setColor
Name
Type
Description
Required/Optional
name
String
Studio ID of the model to apply color to.
Required
color
String
The color is specified as a CSS-style, rgb, or rgba value (for example, rgb(255, 165, 0) or rgba(255, 165, 0, 1.0) for orange). If omitted, the current color is removed.
Required
successCallback
Function
Called when the operation completes successfully.
Optional
errorCallback
Function
Called when the operation fails.
Optional
* 
The color must be provided as a string in either rgba(r,g,b,a) or rgb(r,g,b) format where:
r, g, b are integers between 0 and 255
a is a float between 0.0 and 1.0 (defaults to 1.0 if omitted)
If the color string is invalid, the default fallback is black with full opacity (rgba(0,0,0,1)).
If color is omitted, the previously set color override will be cleared, and the item will render with its default material color.
Was this helpful?