22 January 2020 - Version 1.6.0

This version includes quite a lot of changes, mostly focussed on allowing a more customizable annotation and camera limit experience.
We’ve fixed and added several samples, including a fully custom annotation experience with camera limits at each annotation position.
Check it out here!

New
New URL Parameters
- Use the
annotation_tooltip_visible=0
option to hide annotation tooltips (but not the clickable annotations themselves).
- Use the
api_log=1
option to help find values you need during development. When enabled, data such as background UIDs, environment UIDs, annotation UIDs, and camera limit coordinates will be logged to the browser console.
- Use the
dof_circle=0
option to hide the circle animation / feedback from a click to refocus the camera. This is useful if you are making screenshots or screen recordings from the viewer and you do not want the DoF input feedback visible.
- Use the
wireframe_preload=1
option to force the wireframe to be downloaded, even if it’s not needed as determined by other options (if ui_inspector=
0` and the wireframe is not explicitly enabled in 3D Settings, the wireframe file not be downloaded, by default).
New API Methods
-
recenterCamera()
- Re-centers the camera based on the model/scene bounding box (the same as double-clicking the background or pressing spacebar in the viewer. Among other things, this can be useful for handing portrait/landscape changes on mobile.
-
setCameraConstraints()
- Defines camera limits. To get the camera options as a JS object, try using the ?api_log=1
URL parameter in 3D Settings, for example:
{
position: [0, -5, 1.7],
target: [0, 0, 0]
fov: 45,
nearFarRatio: 0.005,
useCameraConstraints: true,
usePanConstraints: true,
useZoomConstraints: false,
usePitchConstraints: false,
useYawConstraints: false,
zoomIn: 0,
zoomOut: 34,
left: -Math.PI,
right: Math.PI,
up: Math.PI/2,
down: -Math.PI/2
}
New events
- An error is now sent to the Viewer API in the case of a “WebGL Context Lost” event in the browser.
- The API will properly handle various 4xx and 5xx HTTP responses and send an appropriate message to the
error
callback.
Changes
-
getAnimations()
- Now returns a list of animations with their uid
, name
, and duration
, in the same order as the animations are saved in 3D Settings.
Fixes
- The
removeAnnotation()
method and its callback failed if the index of the annotation to remove was the currently selected annotation.
- Removes
getBackgroundList()
and getEnvironmentList()
- these functions did not work as expected. Use the ?api_log=1
URL parameter instead.
Subscribe to this thread to receive updates:
