---
title: 3D viewer changes in 3.0
summary: Every change an application built on the 2.x 3D viewer meets in 3.0 — packaging, the declared types, behaviour behind unchanged methods, section planes, measurements and GIS — with what to do for each.
order: 30
languages: [javascript]
terms: [qid]
see-also: [changelog/v3-0, changelog/v3-0/from-2-to-3, reference/viewer3d, how-to/install/javascript]
---

# 3D viewer changes in 3.0

`@bimworks/viewer3d` keeps its package name, its entry point (`www/viewer3d-index.js`) and its type definitions (`viewer3d.d.ts`). It still needs WebGL2, and the [[js:@bimworks/viewer3d/Viewer3dSettings#technologyAllowed|`technologyAllowed`]] defaults are unchanged: web workers stay off unless you enable them. This page lists everything else an application built on the 2.x 3D viewer sees change in 3.0, and what to do about it. The new features are on [[page:changelog/v3-0]]; [[page:changelog/v3-0/from-2-to-3#javascript]] has the short version, next to the other packages.

Every change has a class:

- **Breaking**: 2.x code fails or gives a wrong result.
- **Behaviour**: the same code runs, but the result or what the user sees differs.
- **Requirement**: how the viewer is installed or served.
- **Deprecated**: still works for now; use the replacement.

## Overview {#overview}

| Change | 2.x | 3.0 | Class | What to do |
|---|---|---|---|---|
| Dependencies | — | needs the 3.0 `@bimworks/viewercommon` (about 40 new imports) and matching type definitions | Requirement | upgrade the packages together ([below](#packages)) |
| `Version` export | `Version` | [[js:@bimworks/viewer3d/BuildVersion|`BuildVersion`]] | Breaking | rename |
| Deep imports | the selection-visualization files, `cesium/`, `draco_decoder.*`, `viewobjects.js` | removed; the classes come from the package | Breaking | import from the package |
| Undeclared helpers | `createBox`, `createCylinder`, `createCone`, `createSphere`, `resetCollections`, `startVerticalMove` | removed | Breaking | [[js:@bimworks/viewer3d/Viewer3d#overlays|`overlays`]], [[js:@bimworks/viewer3d/Viewer3d#resetResults|`resetResults()`]], [[js:@bimworks/viewer3d/Viewer3d#startObjectTransform|`startObjectTransform()`]] |
| `bimSurfer` | declared | gone from the types; its internals changed | Breaking for code that reaches into it | use the declared API ([below](#declared-api)) |
| [[js:@bimworks/viewer3d/MultiSelectMode|`MultiSelectMode`]] | an enum | [[js:@bimworks/viewer3d/MultiSelectMode|`"SHIFT" \| "AUTO"`]] | Breaking (TypeScript) | use the strings |
| [[js:@bimworks/viewer3d/WireframeSelectionVisualization|`WireframeSelectionVisualization`]] | `(color, thickness)` | `(color)`; a colour may be a CSS string | Breaking (TypeScript) | drop the thickness |
| [[js:@bimworks/viewer3d/SectionPlanes#startTopPlane|`startTopPlane()`]] and the other side starters | return a [[js:@bimworks/viewer3d/SectionPlane|`SectionPlane`]] | [[js:@bimworks/viewer3d/SectionPlane|`SectionPlane \| null`]]; planes share six slots, one per normal, without fixed positions; Ctrl+drag no longer replaces the top plane; a section box turns into six planes; GIS layers are not cut | Breaking for code that uses slot numbers; Behaviour | find planes with [[js:@bimworks/viewer3d/SectionPlanes#getPlanes|`getPlanes()`]] and [[js:@bimworks/viewer3d/SectionPlane#getStandard|`getStandard()`]] ([below](#section-planes)) |
| [[js:@bimworks/viewer3d/Viewer3dSettings#rightMouseClick|`rightMouseClick(event, qid)`]] | the second argument was an internal number | a qid, plus a [[js:@bimworks/viewer3d/PickResult|`pick`]]; also on a touch long press | Behaviour | drop workarounds for the number |
| Background | opaque white; [[js:@bimworks/viewer3d/Viewer3d#setBackgroundColor|`setBackgroundColor`]] came out white | grey-blue gradient; [[js:@bimworks/viewer3d/Viewer3d#setBackgroundColor|`setBackgroundColor`]] works | Behaviour | set a colour to keep white |
| Transparency | [[js:@bimworks/viewer3d/Viewer3dSettings#realtimeSettings|`orderIndependentTransparency: false`]] | `true` | Behaviour | set `false` to keep the 2.x look |
| Keys and mouse | — | PageUp/PageDown jump storeys; O and M are bound; Space jumps in walk and game mode; Escape leaves any mode but the default; a right or middle click leaves pointer lock; the canvas takes focus | Behaviour | review your own key handling |
| Walk mode | speed from the depth under the cursor | a fixed 1.5 m/s; collision and gravity where the instance has walkable surfaces | Behaviour | — |
| Loading | [[js:@bimworks/viewer3d/Viewer3d#addModels|`addModels`]] never settled on a failure | [[js:@bimworks/viewer3d/Viewer3d#initializeViewer|`initializeViewer()`]] waits for models already in the [[js:@bimworks/viewercommon/ModelManager|ModelManager]]; [[js:@bimworks/viewer3d/Viewer3d#addModels|`addModels`]] rejects | Behaviour | add error handling |
| Geometry transport | WebSocket | an HTTP stream (`fetch`), with the WebSocket as fallback | Behaviour | a page on another origin needs CORS |
| [[js:@bimworks/viewer3d/Camera#setViewpoint|`Camera.setViewpoint`]] | the direction used as given | the direction scaled ×1000, so the orbit target lies at the real distance | Behaviour | check restored views |
| GEO mode | offsets from the server | computed in the browser on one plane, with elevation and true north | Breaking (GEO mode only) | store GEO-mode viewpoints and measurements again |
| Annotations | always drawn | hidden behind geometry ([[js:@bimworks/viewercommon/Annotation#occlusion|`occlusion: "hide"`]]); an explicit [[js:@bimworks/viewercommon/Annotation#position|`position`]] wins over the qid's box | Behaviour | set [[js:@bimworks/viewercommon/Annotation#occlusion|`occlusion`]] |
| Measurements | fixed when finished; `toString()` printed millimetres with "m" | points can be dragged ([[js:@bimworks/viewer3d/MeasuringListener#committed|`committed`]] fires again), a loupe, edge snapping, a delete button; `toString()` in metres | Behaviour | handle repeated [[js:@bimworks/viewer3d/MeasuringListener#committed|`committed`]] |
| GIS | — | invisible layers are only registered, [[js:@bimworks/viewer3d/Viewer3d#toggleGisLayer|`toggleGisLayer`]] returns a Promise, imagery drapes over terrain, content within 500 m of the models | Behaviour | — |
| WebGL context loss | — | stops the viewer and calls the engine-failure listeners | Behaviour | listen for it |
| Flat scenes (a PDF or DWG on its own) | 3D navigation | 2D interaction: a turning dial, a pan that follows the pointer, pinch | Behaviour | — |

## Packages and loading {#packages}

**The 3.0 viewercommon** (Requirement). The 3.0 viewer imports about 40 names that only the 3.0 `@bimworks/viewercommon` exports: the selection visualizations, the mouse-button and selection-mode constants, [[js:@bimworks/viewercommon/versionOfQid|`versionOfQid`]], the error classes, the cursor loupe, viewpoints and the annotation templates. A module that imports a missing name does not load at all, so next to a 2.x viewercommon the 3.0 viewer never starts. Its type definitions import types from viewercommon, `@bimworks/jssdk` and `@sascom/commonjs`. Upgrade `@bimworks/jssdk`, `@bimworks/viewercommon`, `@bimworks/viewer3d`, `@sascom/commonjs` and `@sascom/jsclient` together, to the version of the instance ([[page:how-to/install/javascript]]).

**[[js:@bimworks/viewer3d/BuildVersion|`BuildVersion`]]** (Breaking). The export `Version`, the viewer's build string, is now [[js:@bimworks/viewer3d/BuildVersion|`BuildVersion`]]; `import {Version} from "@bimworks/viewer3d"` fails when the module links. jssdk uses the name [[js:@bimworks/jssdk/Version|`Version`]] for a model version, which is why it changed. The same rename happened in jssdk, viewercommon and viewer2d.

**Deep imports** (Breaking). The files `wireframeselectionvisualization.js`, `fatwireframeselectionvisualization.js`, `noneselectionvisualization.js`, `selectionvisualization.js`, `viewobjects.js`, `compactbounds.js`, `terrainrenderlayer.js`, `tiledrenderlayerwithterrain.js`, the vendored `cesium/` folder, `draco_decoder.js` and `.wasm` and the terrain shaders are gone. The selection visualizations are the viewercommon classes, exported again from the package root, so both 3D viewers share one class identity. Import from `@bimworks/viewer3d` or `@bimworks/viewercommon`, never from `@bimworks/viewer3d/www/…`.

**The single-file build** (Requirement). `viewer3d.bimworks.js` loads its workers from `workers/`, and their code from `assets/`, next to the file; 2.x loaded them from `/workers/` at the root of the site. Copy both folders next to the file ([[page:how-to/install/downloads]]).

**The npm package**. It ships `www/` and `viewer3d.d.ts` only, and its JavaScript without comments; the type definitions are the documentation. The Draco decoder is still fetched at run time from `www.gstatic.com` (now 1.5.9), so a page's Content-Security-Policy has to allow it, as in 2.x. The viewer needs no stylesheet.

## The declared API {#declared-api}

**`bimSurfer`** (Breaking for code that uses it). `readonly bimSurfer` is gone from the type definitions. The object still exists at run time, but placement, picking and the camera classes inside it changed, so a 2.x reach-in such as `bimSurfer.viewer.pick` or `bimSurfer.globalBaseTranslation` breaks. Use the declared API instead: [[js:@bimworks/viewer3d/Viewer3d#pick|`pick(x, y)`]], [[js:@bimworks/viewer3d/Viewer3d#getCamera|`getCamera()`]] with [[js:@bimworks/viewer3d/Camera#eye|`eye`]], [[js:@bimworks/viewer3d/Camera#target|`target`]], [[js:@bimworks/viewer3d/Camera#up|`up`]], [[js:@bimworks/viewer3d/Camera#viewMatrix|`viewMatrix`]] and [[js:@bimworks/viewer3d/Camera#projMatrix|`projMatrix`]], [[js:@bimworks/viewer3d/Viewer3d#measurementToRenderCoordinates|`measurementToRenderCoordinates()`]] and the other conversions, [[js:@bimworks/viewer3d/Viewer3d#overlays|`overlays`]], [[js:@bimworks/viewer3d/Viewer3d#resetResults|`resetResults()`]] and [[js:@bimworks/viewer3d/Viewer3d#isRunning|`isRunning()`]].

**Undeclared helpers** (Breaking). `createBox`, `createCylinder`, `createCone`, `createSphere`, `resetCollections()` and `startVerticalMove()` were never declared and are gone. Draw helper geometry with [[js:@bimworks/viewer3d/OverlayManager#add|`viewer.overlays.add(...)`]] (arrows, areas, labels, paths, meshes and glTF), clear what a BVL or BCL result drew with [[js:@bimworks/viewer3d/Viewer3d#resetResults|`resetResults()`]], and move or rotate objects with [[js:@bimworks/viewer3d/Viewer3d#startObjectTransform|`startObjectTransform(qids, {mode: "move"})`]] or [[js:@bimworks/viewer3d/Viewer3d#startObjectTransform|`{mode: "rotate"}`]].

**Declarations that never worked**. `getName()`, `activateHistory()`, `getHistoryItem()`, `updateCameraTargetToAabbOf()` and `addVertexClickListener()` were declared in 2.x but threw a `TypeError` when called. They are gone from the types; nothing that worked stops working.

**Dropped from the types, still at run time** (Deprecated). `colorChanged(qids, color)`, which the [[js:@bimworks/viewercommon/ObjectStateManager|ObjectStateManager]] never calls; `createDefaultRenderLayer()`, which now takes a render mode; `internalLoadGisLayer()`, which now returns a promise. Use [[js:@bimworks/viewercommon/ObjectStateManager#changeColor|`ObjectStateManager.changeColor`]], [[js:@bimworks/viewer3d/Viewer3d#overlays|`overlays`]] and [[js:@bimworks/viewer3d/Viewer3d#toggleGisLayer|`toggleGisLayer`]] instead.

**[[js:@bimworks/viewer3d/MultiSelectMode|`MultiSelectMode`]]** (Breaking, TypeScript only). The enum is the string type [[js:@bimworks/viewer3d/MultiSelectMode|`"SHIFT" | "AUTO"`]]. The 2.x enum never existed at run time, so `MultiSelectMode.SHIFT` did not work then either. Pass `"SHIFT"` or `"AUTO"`. [[js:@bimworks/viewer3d/Viewer3d#getMultiSelectMode|`getMultiSelectMode()`]] is new, and the mode may be set before the viewer is initialized.

**Selection visualizations** (Breaking, TypeScript only). [[js:@bimworks/viewer3d/WireframeSelectionVisualization|`WireframeSelectionVisualization(color, thickness)`]] is `(color)`, and the colour may be a CSS colour, an array or a `Float32Array`; in 2.x a CSS string did not work. Every visualization has [[js:@bimworks/viewer3d/SelectionVisualization#extendedObbEnabled|`extendedObbEnabled`]] and [[js:@bimworks/viewer3d/SelectionVisualization#extendedObbColor|`extendedObbColor`]]. The default is still an orange wireframe. [[js:@bimworks/viewer3d/FaceAndWireframeSelectionVisualization|`FaceAndWireframeSelectionVisualization`]], [[js:@bimworks/viewer3d/XRaySelectionVisualization|`XRaySelectionVisualization`]] and [[js:@bimworks/viewer3d/XRayVisualization|`XRayVisualization`]] are new.

**Side starters may return `null`** (Breaking with `strictNullChecks`). [[js:@bimworks/viewer3d/SectionPlanes#startTopPlane|`startTopPlane()`]], [[js:@bimworks/viewer3d/SectionPlanes#startBottomPlane|`startBottomPlane()`]], [[js:@bimworks/viewer3d/SectionPlanes#startLeftPlane|`startLeftPlane()`]], [[js:@bimworks/viewer3d/SectionPlanes#startRightPlane|`startRightPlane()`]], [[js:@bimworks/viewer3d/SectionPlanes#startFrontPlane|`startFrontPlane()`]] and [[js:@bimworks/viewer3d/SectionPlanes#startBackPlane|`startBackPlane()`]] are typed [[js:@bimworks/viewer3d/SectionPlane|`SectionPlane | null`]] ([below](#section-planes)).

**Type corrections**. These change no behaviour:

- Return types are concrete: [[js:@bimworks/viewer3d/Viewer3d#addModels|`addModels()`]] and [[js:@bimworks/viewer3d/Viewer3d#viewFit|`viewFit()`]] return `Promise<void>`, [[js:@bimworks/viewer3d/Viewer3d#toggleFullScreen|`toggleFullScreen()`]] and [[js:@bimworks/viewer3d/Viewer3d#toggleAnimationEnabled|`toggleAnimationEnabled()`]] a `boolean`, [[js:@bimworks/viewer3d/Viewer3d#getCanvas|`getCanvas()`]] an `HTMLCanvasElement`. [[js:@bimworks/viewer3d/Viewer3d#toggleGisLayer|`toggleGisLayer`]] and [[js:@bimworks/viewer3d/Viewer3d#updateModel|`updateModel`]] return promises at run time too.
- The listener methods the managers call take a [[js:@bimworks/jssdk/QidSet|`QidSet`]] and further arguments, so TypeScript that calls them with arrays no longer compiles. [[js:@bimworks/viewer3d/Viewer3d#removeModels|`removeModels`]] takes versions and [[js:@bimworks/viewer3d/Viewer3d#modelsShown|`modelsShown`]] takes vids, as the code always did.
- [[js:@bimworks/viewer3d/LoadProgressHandler|`LoadProgressHandler`]] callbacks get the `managerIndex`.
- [[js:@bimworks/viewer3d/GisLayer#url|`GisLayer.url`]] is optional; [[js:@bimworks/viewer3d/GisLayer#type|`type`]] includes [[js:@bimworks/viewer3d/GisLayer#type|`"UPLOADED_GIS"`]]; [[js:@bimworks/viewer3d/GisLayer|`GisLayer`]] and [[js:@bimworks/viewer3d/ScreenshotOptions|`ScreenshotOptions`]] are exported.
- [[js:@bimworks/viewer3d/KeyBindingAction|`KeyBindingAction`]] includes [[page:reference/viewer3d/key-bindings#toggleareaholes|`toggleAreaHoles`]], [[page:reference/viewer3d/key-bindings#storeyup|`storeyUp`]] and [[page:reference/viewer3d/key-bindings#storeydown|`storeyDown`]].
- [[js:@bimworks/viewer3d/MAIN_MOUSE_BUTTON|`MAIN_MOUSE_BUTTON`]], [[js:@bimworks/viewer3d/AUX_MOUSE_BUTTON|`AUX_MOUSE_BUTTON`]] and [[js:@bimworks/viewer3d/SECONDARY_MOUSE_BUTTON|`SECONDARY_MOUSE_BUTTON`]] are declared with the values they had at run time.
- Two descriptions are corrected: the section planes and the section box follow the models' oriented box, as they already did, and [[js:@bimworks/viewer3d/Viewer3dSettings#fatWireframes|`fatWireframes.enabled`]] and [[js:@bimworks/viewer3d/Viewer3dSettings#fatWireframes|`cache`]] default to `false`.

## Behaviour behind the same API {#behaviour}

**The context menu** (Behaviour). [[js:@bimworks/viewer3d/Viewer3dSettings#rightMouseClick|`rightMouseClick(event, qid, pick)`]] gets a real qid; 2.x passed the viewer's internal number although the types said qid. The third argument is the pick: the qid, the point in render coordinates and the unit normal. On a touch screen a long press selects the object under the finger, when nothing is selected, and calls the callback too. Drop any conversion from the internal number, and use [[js:@bimworks/viewer3d/PickResult|`pick`]] instead of picking a second time ([[page:reference/viewer3d#rightmouseclick]]).

**The background** (Behaviour). The canvas is a vertical gradient from `#EDF1F4` at the top to `#BFCAD3` at the bottom; 2.x cleared it white. [[js:@bimworks/viewer3d/Viewer3d#setBackgroundColor|`setBackgroundColor(c)`]] now shows the colour (in 2.x almost every colour came out white) and switches the gradient off; [[js:@bimworks/viewer3d/Viewer3d#setBackgroundGradientEnabled|`setBackgroundGradientEnabled(true)`]] puts it back. Screenshots show the gradient too. Call [[js:@bimworks/viewer3d/Viewer3d#setBackgroundColor|`setBackgroundColor("#FFFFFF")`]] to keep the 2.x look.

**Transparency** (Behaviour). [[js:@bimworks/viewer3d/Viewer3dSettings#realtimeSettings|`realtimeSettings.orderIndependentTransparency`]] defaults to `true`: spaces, glass and every transparent colour blend without draw-order artefacts, look different and cost differently. Pass [[js:@bimworks/viewer3d/Viewer3dSettings#realtimeSettings|`realtimeSettings: {orderIndependentTransparency: false}`]] to keep the 2.x rendering.

**Keys and mouse** (Behaviour). Changed defaults:

- PageUp and PageDown jump a storey up or down ([[page:reference/viewer3d/key-bindings#storeyup|`storeyUp`]], [[page:reference/viewer3d/key-bindings#storeydown|`storeyDown`]]), which needs walk physics; in 2.x they moved the camera up and down. Free vertical movement is Q and Z only.
- O switches an area measurement between gross, net and hull, or the reference of an object distance.
- M switches the measuring loupe on and off.
- Space still toggles auto-rotation, but in walk and game mode it jumps.
- Escape returns any navigation mode but the default to the default, walk included, and deselects a selected measurement when no tool runs.
- A right or middle click while the pointer is locked (game, drone, or a custom mode with [[js:@bimworks/viewer3d/NavigationModeSettings#pointerLock|`pointerLock`]]) leaves the mode.
- Ctrl+Shift+F12 opens a diagnostics panel.
- The canvas can take focus and is in the tab order, so a page's `:focus-visible` style may draw on it; [[js:@bimworks/viewer3d/Viewer3d#focus|`focus()`]] no longer scrolls the page to it.

Unchanged: WSADQZ and the arrow keys in every mode, the mouse buttons (orbit, pan with the middle button or Shift, section with Ctrl, look around with Alt), [[js:@bimworks/viewer3d/Viewer3dSettings#hideObjectOnMiddleClick|`hideObjectOnMiddleClick`]], and H, C, D, F, Home, Insert, Enter and Delete. Override a key per mode with [[js:@bimworks/viewer3d/NavigationModeSettings#keyBindings|`navigationModes.<mode>.keyBindings`]] (an empty array disables an action), or claim it with [[js:@bimworks/viewer3d/Viewer3d#addKeyHandler|`addKeyHandler`]] ([[page:reference/viewer3d/key-bindings]]).

**Walking** (Behaviour). Walk mode moves at a fixed 1.5 m/s and turns 25° a second; 2.x took its pace from the depth under the cursor, so it surged and stalled. [[js:@bimworks/viewer3d/NavigationModeSettings#navigationSpeed|`navigationSpeed`]] scales walk mode too, and every mode's movement no longer depends on the frame rate. When the instance generates walkable surfaces (the `walkable_surfaces` feature, off by default), walk and game mode get collision, gravity, steps, jumps and storey jumps; without them navigation is as before. Pass [[js:@bimworks/viewer3d/NavigationModeSettings#collision|`collision: false`]] in a custom mode to keep free walking ([[page:how-to/viewer3d/walk-mode]]).

**Wheel zoom** (Behaviour). A touchpad zooms by how far it scrolls (100 pixels or three lines make one notch) instead of a full notch per event, and notches queue into one animated approach. Shift still zooms five times as far. [[js:@bimworks/viewer3d/Viewer3d#zoomSteps|`zoomSteps(steps, pos)`]] does the same from code.

**Flat scenes** (Behaviour). A scene without height, such as a PDF or a DWG on its own, gets 2D interaction: a drag turns the plan around the point pressed, with a dial and square snapping; a pan follows the pointer one to one; two fingers pan and pinch. When a model with height joins or leaves, the default view is redone. [[js:@bimworks/viewer3d/Viewer3d#set2dMode|`set2dMode`]] and [[js:@bimworks/viewer3d/Viewer3d#is2dMode|`is2dMode`]] are new ([[page:how-to/viewer3d/show-a-floor-plan]]).

**Loading** (Behaviour). [[js:@bimworks/viewer3d/Viewer3d#initializeViewer|`initializeViewer()`]] resolves when the models already in the [[js:@bimworks/viewercommon/ModelManager|ModelManager]] have loaded, so creating the viewer after loading models takes longer; errors there are logged, not thrown. [[js:@bimworks/viewer3d/Viewer3d#addModels|`addModels`]] rejects when loading fails (2.x never settled), with [[js:@bimworks/viewercommon/IncompleteVersionError|`IncompleteVersionError`]] for a version without its metadata [[js:@bimworks/viewer3d/ModelNotAvailableOfflineError|`ModelNotAvailableOfflineError`]] in offline mode, and [[js:@bimworks/viewer3d/GeometryNotAvailableError|`GeometryNotAvailableError`]] for a model the instance has no geometry for, once the other models of the call have loaded; [[js:@bimworks/viewer3d/Viewer3dSettings#pointClouds|`pointClouds: false`]] leaves point clouds out. For a raster PDF, a GLB and a chunked E57 the promise still resolves before their content has loaded. [[js:@bimworks/viewer3d/Viewer3d#updateModel|`updateModel`]] waits for the model to be placed again and rejects on failure. Add error handling where you await them.

**Geometry transport** (Behaviour). Geometry comes over an HTTP stream (`DownloadGeometry3DStream`, then `fetch` with CORS) and falls back to the WebSocket when the stream fails before its first chunk. A model the instance has no geometry for (`DATA_NOT_FOUND`) is no such failure: it is not asked again. A viewer page on another origin than the instance needs the instance to allow that origin, otherwise every model logs a fallback warning and loads over the WebSocket; so does a page behind a proxy that blocks streamed responses.

**GEO mode** (Breaking for stored GEO-mode coordinates). 2.x took GEO offsets from the server, picked a UTM zone per model and used the first model's offset as the render offset. 3.0 places the models in the browser on one east-north-up plane at the first model's georeference, with their elevation, and rotates by the grid convergence so north is true north; a stored alignment applies in GEO mode too, and the render offset is zero. So in GEO mode [[js:@bimworks/viewer3d/Camera#getViewpoint|`Camera.getViewpoint()`]], measurement coordinates, point labels, [[js:@bimworks/viewer3d/Viewer3d#getMainBounds|`getMainBounds()`]] and section-plane positions are in another frame than in 2.x, and models in one scene can shift in height and turn by the convergence angle (models across a UTM zone border are no longer scattered). LOCAL mode is unchanged. Store GEO-mode viewpoints and measurements again, or keep them in LOCAL mode or in model coordinates ([[js:@bimworks/viewer3d/Viewer3d#renderToMeasurementCoordinates|`renderToMeasurementCoordinates`]], [[js:@bimworks/viewer3d/Viewer3d#measurementToModelCoordinates|`measurementToModelCoordinates`]]) ([[page:how-to/viewer3d/geo-mode]]).

**[[js:@bimworks/viewer3d/Camera#setViewpoint|`Camera.setViewpoint`]]** (Behaviour). The direction is scaled ×1000, so a view from [[js:@bimworks/viewer3d/Camera#getViewpoint|`getViewpoint()`]] orbits around its real target; a BCF unit direction puts the target 1 m ahead. In 2.x the target landed millimetres in front of the eye. Code that scaled the direction itself now puts the target 1000 times too far ([[page:how-to/viewer3d/set-the-camera]]).

**Annotations** (Behaviour). [[js:@bimworks/viewercommon/Annotation#occlusion|`Annotation.occlusion`]] defaults to `"hide"`: an annotation whose point or object is behind other geometry is hidden once the camera settles. An explicit [[js:@bimworks/viewercommon/Annotation#position|`position`]] wins over the qid; without one, the anchor is the centre of the object's box in its model's own axes. Section planes still hide what they cut away. Set [[js:@bimworks/viewercommon/Annotation#occlusion|`occlusion = "none"`]] for the 2.x behaviour ([[page:how-to/viewer3d/annotations#occlusion]]).

**WebGL context loss** (Behaviour). When the browser takes the WebGL context away, the viewer stops drawing and picking and calls the [[js:@bimworks/viewer3d/Viewer3d#addEngineFailureListener|`addEngineFailureListener`]] listeners once, with `{engine: "webgl", reason: "context-lost"}`; it does not restore itself. 2.x did not notice. Rebuild the viewer, or reload, from the listener.

**[[js:@bimworks/viewer3d/Viewer3d#viewFitModels|`viewFitModels`]]** (Behaviour, a fix). It skips models that are not loaded in the viewer (2.x threw) and fits correctly in GEO mode.

**Smaller changes**:

- The container gets `aria-busy`, `data-viewer-loading`, `data-viewer-models` and `data-viewer-load-errors`; the loading indicator has `role="status"`.
- [[js:@bimworks/viewer3d/Viewer3d#setMode|`setMode("GEO")`]] returns `false` in offline mode; GEO mode shows a DWG's model space only.
- On touch-only devices [[js:@bimworks/viewer3d/Viewer3dSettings#realtimeSettings|`realtimeSettings.progressiveFullDetail`]] defaults to `true`, and culling budgets adapt when culling is on.
- [[js:@bimworks/viewer3d/Viewer3d#setMultiSelectMode|`setMultiSelectMode`]], [[js:@bimworks/viewer3d/Viewer3d#setObjectHoverEnabled|`setObjectHoverEnabled`]] and [[js:@bimworks/viewer3d/Viewer3d#addGisLayer|`addGisLayer`]] with an invisible layer may be called before the viewer is initialized.
- [[js:@bimworks/viewer3d/Viewer3d#hoverOn|`hoverOn`]] never did anything; that is now documented, and [[js:@bimworks/viewer3d/Viewer3d#linkCamera|`linkCamera()`]] is new.

## Section planes {#section-planes}

In 2.x the six side starters each owned a slot: [[js:@bimworks/viewer3d/SectionPlanes#startTopPlane|`startTopPlane()`]] slot 0, bottom 1, left 2, right 3, front 4, back 5. A Ctrl+drag plane always took slot 0, and a starter without a loaded model threw a `TypeError`.

**No fixed slots** (Breaking for code that uses slot numbers). [[js:@bimworks/viewer3d/SectionPlanes#startTopPlane|`startTopPlane()`]] is [[js:@bimworks/viewer3d/SectionPlanes#startStandardPlane|`startStandardPlane("top")`]]. When the top plane already cuts, it goes back to its place; otherwise it takes the slot of a plane that cuts with the same normal (within 1°), replacing it, or else the lowest free slot. [[js:@bimworks/viewer3d/SectionPlanes#get|`get(0)`]] is no longer the top plane. [[js:@bimworks/viewer3d/SectionPlanes#startAabbPlane|`startAabbPlane(index)`]] is deprecated and maps the index to a side. Planes have names ("Top", "Plane 1", …). Keep the returned [[js:@bimworks/viewer3d/SectionPlane|`SectionPlane`]], or find it with [[js:@bimworks/viewer3d/SectionPlanes#getPlanes|`getPlanes()`]] and [[js:@bimworks/viewer3d/SectionPlane#getStandard|`getStandard()`]] ([[page:how-to/viewer3d/section-planes#list]]).

**Ctrl+drag adds a plane** (Behaviour). Ctrl+drag, the face widget and the context-menu recipe take the slot of the plane with the same normal or a free one, so a user can cut with several planes; in 2.x each replaced the top plane.

**One plane per normal** (Behaviour). Every start, [[js:@bimworks/viewer3d/SectionPlanes#startPlaneWithCoordinateAndNormal|`startPlaneWithCoordinateAndNormal`]] with an explicit slot and [[js:@bimworks/viewer3d/SectionPlanes#setState|`setState`]] included, switches off another plane that cuts with the same normal (within 1°). Two parallel planes facing the same way cannot cut together; opposite normals can.

**`null`** (Behaviour). The starters and [[js:@bimworks/viewer3d/SectionPlanes#startPlaneAt|`startPlaneAt`]] return `null` when no model is loaded, or when all six slots cut with other normals.

**The section box** (Behaviour). The box's six faces are the side planes "Top" to "Back". A starter puts its face back on the model's face and dissolves the box: the other five faces stay where they are, as separate planes; switching one face off does the same. 2.x cleared the box and every plane. [[js:@bimworks/viewer3d/SectionPlanes#startSectionBox|`startSectionBox`]] still clears all planes, and also takes [[js:@bimworks/viewer3d/SectionPlanes#startSectionBox|`{min, max}`]] and [[js:@bimworks/viewer3d/SectionPlanes#startSectionBox|`{padding}`]].

**GIS layers are not cut** (Behaviour). 3D Tiles and uploaded GIS objects are not sectionable; in 2.x a section plane also cut every 3D Tiles building. Terrain and imagery were never cut; GLB models still are.

Unchanged: [[js:@bimworks/viewer3d/SectionPlanes#disableAll|`disableAll()`]], [[js:@bimworks/viewer3d/SectionPlanes#hatching|`hatching`]], [[js:@bimworks/viewer3d/SectionPlanes#endcaps|`endcaps`]] and [[js:@bimworks/viewer3d/SectionPlanes#showIcons|`showIcons`]] (all on by default), and [[js:@bimworks/viewer3d/SectionPlane#disable|`SectionPlane.disable()`]].

## Measurements {#measurements}

**Finished measurements can be edited** (Behaviour). [[js:@bimworks/viewer3d/Measurement#editable|`Measurement.editable`]] defaults to `true`: the points of a finished area, path or point measurement, and a laser as a whole, can be dragged. During the drag [[js:@bimworks/viewer3d/MeasuringListener#startedUpdate|`startedUpdate`]] fires, and on release [[js:@bimworks/viewer3d/MeasuringListener#committed|`committed`]] fires **again** for the same measurement; Escape fires [[js:@bimworks/viewer3d/MeasuringListener#cancelled|`cancelled`]] and puts it back. An application that stores measurements in [[js:@bimworks/viewer3d/MeasuringListener#committed|`committed`]] has to update by [[js:@bimworks/viewer3d/Measurement#id|`id`]] instead of inserting. Set [[js:@bimworks/viewer3d/Measurement#editable|`measurement.editable = false`]] to keep the 2.x behaviour ([[page:how-to/viewer3d/measure]]).

**Loupe, edge snapping, delete button** (Behaviour). While a point tool aims with a mouse or pen, a loupe follows the cursor ([[js:@bimworks/viewer3d/Measuring#magnifier|`magnifier`]], on by default; M toggles it). Snapping includes model edges, not only vertices. A selected measurement shows a delete button. Escape with no tool running deselects the selected measurement; Escape that stops a tool, [[js:@bimworks/viewer3d/Measuring#stopActiveMeasurement|`stopActiveMeasurement()`]] and [[js:@bimworks/viewer3d/Measuring#removeAllMeasurements|`removeAllMeasurements()`]] give the clicks back to the viewer's selection mode, rectangle selection included.

**`toString()` in metres** (Behaviour, a fix). [[js:@bimworks/viewer3d/DistanceMeasurement|`DistanceMeasurement`]] and [[js:@bimworks/viewer3d/PathMeasurement|`PathMeasurement`]] printed the length in millimetres followed by "m" ("4235.12m" for 4.24 m); they print metres now. [[js:@bimworks/viewer3d/DistanceMeasurement#length|`length`]] is still in millimetres.

Unchanged: [[js:@bimworks/viewer3d/Measuring#addDistanceMeasurement|`addDistanceMeasurement`]], [[js:@bimworks/viewer3d/Measuring#addPathMeasurement|`addPathMeasurement`]], the [[js:@bimworks/viewer3d/Measuring|`start…Measurement`]] methods (a distance is still constrained by default), [[js:@bimworks/viewer3d/Measuring#listMeasurements|`listMeasurements`]], [[js:@bimworks/viewer3d/Measuring#removeMeasurement|`removeMeasurement`]], [[js:@bimworks/viewer3d/Measuring#removeAllMeasurements|`removeAllMeasurements`]], the order of [[js:@bimworks/viewer3d/MeasuringListener#startedNew|`startedNew`]], [[js:@bimworks/viewer3d/MeasuringListener#cancelled|`cancelled`]] and [[js:@bimworks/viewer3d/MeasuringListener#deleted|`deleted`]], ids unique across viewers, and the point measurement's default label. GEO-mode coordinates differ ([above](#behaviour)).

## GIS layers {#gis}

**GIS layers** (Behaviour):

- [[js:@bimworks/viewer3d/Viewer3d#addGisLayer|`addGisLayer`]] with [[js:@bimworks/viewer3d/GisLayer#visible|`visible`]] not `true` only registers the layer.
- [[js:@bimworks/viewer3d/Viewer3d#toggleGisLayer|`toggleGisLayer`]] returns a Promise that resolves when the layer has loaded. It still throws the string `"Unknown GIS layer: …"` for an unknown id, and returns `undefined` when nothing changes.
- Imagery (TMS, WMS, WMTS) drapes over a visible terrain layer, and a terrain with imagery on it is not drawn on its own; a terrain alone is flat light blue.
- GIS content is drawn and requested within the models' bounding circle plus [[js:@bimworks/viewer3d/Viewer3dSettings#gisRadiusMeters|`gisRadiusMeters`]] (500 m by default).
- 3D Tiles are placed in height with [[js:@bimworks/viewer3d/GisLayer#heightDatum|`heightDatum`]], [[js:@bimworks/viewer3d/GisLayer#heightOffsetMeters|`heightOffsetMeters`]] and [[js:@bimworks/viewer3d/GisLayer#snapToZero|`snapToZero`]] (on by default).

## New, nothing to change {#additive}

Nothing below changes unless you use it; [[page:reference/viewer3d]] describes each.

- Offline mode: [[js:@bimworks/viewer3d/Viewer3d#prepareOfflineModels|`prepareOfflineModels`]], [[js:@bimworks/viewer3d/Viewer3d#removeOfflineModels|`removeOfflineModels`]], [[js:@bimworks/viewer3d/Viewer3d#getOfflineModels|`getOfflineModels`]], [[js:@bimworks/viewer3d/Viewer3d#getOfflineVersions|`getOfflineVersions`]], [[js:@bimworks/viewer3d/Viewer3d#setOfflineMode|`setOfflineMode`]], [[js:@bimworks/viewer3d/Viewer3d#isOfflineMode|`isOfflineMode`]] ([[page:how-to/viewer3d/work-offline]]).
- Picking and tools: [[js:@bimworks/viewer3d/Viewer3d#pick|`pick(x, y)`]], [[js:@bimworks/viewer3d/Viewer3d#selectObject|`selectObject`]], [[js:@bimworks/viewer3d/Viewer3d#cancelObjectSelection|`cancelObjectSelection`]], [[js:@bimworks/viewer3d/Viewer3d#setClickHandler|`setClickHandler`]], [[js:@bimworks/viewer3d/Viewer3d#selectVertex|`selectVertex(fn, {snapping})`]], [[js:@bimworks/viewer3d/Viewer3d#startObjectTransform|`startObjectTransform`]], [[js:@bimworks/viewer3d/Viewer3d#startExtrusionDrawing|`startExtrusionDrawing`]], [[js:@bimworks/viewer3d/Viewer3d#addKeyHandler|`addKeyHandler`]].
- Coordinates: [[js:@bimworks/viewer3d/CoordinateFrame|`CoordinateFrame`]], [[js:@bimworks/viewer3d/Viewer3d#modelToMeasurementCoordinates|`modelToMeasurementCoordinates`]] and the other conversions, [[js:@bimworks/viewer3d/Viewer3d#getModelLengthUnitMm|`getModelLengthUnitMm`]], [[js:@bimworks/viewer3d/Viewer3d#getModelBounds|`getModelBounds`]], [[js:@bimworks/viewer3d/Viewer3d#getModelFrameBounds|`getModelFrameBounds`]], [[js:@bimworks/viewer3d/Viewer3d#getObjectsObb|`getObjectsObb`]], [[js:@bimworks/viewer3d/Viewer3d#getObjectsAabb|`getObjectsAabb`]], [[js:@bimworks/viewer3d/Viewer3d#frames|`frames`]].
- Camera: [[js:@bimworks/viewer3d/Camera#getMillimetresPerPixel|`getMillimetresPerPixel`]], [[js:@bimworks/viewer3d/Camera#eye|`eye`]], [[js:@bimworks/viewer3d/Camera#target|`target`]], [[js:@bimworks/viewer3d/Camera#center|`center`]], [[js:@bimworks/viewer3d/Camera#up|`up`]], the view and projection matrices, [[js:@bimworks/viewer3d/Camera#interpolateView|`interpolateView`]], [[js:@bimworks/viewer3d/Camera#orbitYaw|`orbitYaw`]], [[js:@bimworks/viewer3d/Camera#viewFit|`viewFit({box})`]], [[js:@bimworks/viewer3d/Camera#isAtRest|`isAtRest`]], [[js:@bimworks/viewer3d/Viewer3d#linkCamera|`linkCamera`]], [[js:@bimworks/viewer3d/Viewer3d#zoomSteps|`zoomSteps`]], [[js:@bimworks/viewer3d/Viewer3d#resetToDefaultView|`resetToDefaultView`]].
- View state: [[js:@bimworks/viewer3d/Viewer3d#captureViewState|`captureViewState`]], [[js:@bimworks/viewer3d/Viewer3d#restoreViewState|`restoreViewState`]], [[js:@bimworks/viewer3d/Viewer3d#viewpoints|`viewpoints`]], [[js:@bimworks/viewer3d/SectionPlanes#getState|`SectionPlanes.getState`]] and [[js:@bimworks/viewer3d/SectionPlanes#setState|`setState`]].
- Section planes: [[js:@bimworks/viewer3d/SectionPlanes#startStandardPlane|`startStandardPlane`]], [[js:@bimworks/viewer3d/SectionPlanes#startPlaneAt|`startPlaneAt`]], [[js:@bimworks/viewer3d/SectionPlanes#getPlanes|`getPlanes`]], [[js:@bimworks/viewer3d/SectionPlanes#canStartPlane|`canStartPlane`]], [[js:@bimworks/viewer3d/SectionPlanes#onPlanesChange|`onPlanesChange`]], [[js:@bimworks/viewer3d/SectionPlanes#onEnabledChange|`onEnabledChange`]], plane names, visibility, highlighting and annotation modes, the section box's annotation and visibility methods, icons, end caps per object and cap styles, [[js:@bimworks/viewer3d/MovablePlanes|`MovablePlanes`]].
- Measurements: area, angle, object distance, the laser, reference geometry (levels, grids, centre lines), snapping, the loupe, undo, touch, [[js:@bimworks/viewer3d/Viewer3d#viewFitMeasurement|`viewFitMeasurement`]] ([[page:how-to/viewer3d/measure-object-distance]]).
- Rendering: the grid, sun and shadows, the x-ray visualization, wireframe overrides, triangle lines, proximity fade, [[js:@bimworks/viewer3d/Viewer3d#setBackgroundGradientEnabled|`setBackgroundGradientEnabled`]], the culling budget ([[page:how-to/viewer3d/grid]], [[page:how-to/viewer3d/proximity-fade]], [[page:how-to/viewer3d/xray-set]]).
- Overlays, figure layers, quantity figures, routes ([[js:@bimworks/viewer3d/Viewer3d#showRoute|`showRoute`]], [[js:@bimworks/viewer3d/Viewer3d#followRoute|`followRoute`]]), the current-space tracker, [[js:@bimworks/viewer3d/Viewer3d#walkPhysicsAvailable|`walkPhysicsAvailable`]].
- 2D mode and plan labels ([[js:@bimworks/viewer3d/Viewer3d#set2dMode|`set2dMode`]], [[js:@bimworks/viewer3d/Viewer3d#is2dMode|`is2dMode`]], [[js:@bimworks/viewer3d/Viewer3d#setPlanLabelsEnabled|`setPlanLabelsEnabled`]], [[js:@bimworks/viewer3d/Viewer3dSettings#planLabels|`planLabels`]]), DWG layouts ([[js:@bimworks/viewer3d/Viewer3d#getDwgSemanticsMap|`getDwgSemanticsMap`]], [[js:@bimworks/viewer3d/Viewer3d#showDwgLayout|`showDwgLayout`]], [[js:@bimworks/viewer3d/Viewer3d#hideDwgSheets|`hideDwgSheets`]]) ([[page:how-to/viewer3d/dwg-drawings]]).
- Models: [[js:@bimworks/viewer3d/Viewer3d#setModelVisible|`setModelVisible`]], [[js:@bimworks/viewer3d/Viewer3d#getModelAlignment|`getModelAlignment`]], [[js:@bimworks/viewer3d/Viewer3d#setModelAlignment|`setModelAlignment`]], [[js:@bimworks/viewer3d/Viewer3d#getModelsWithoutGeoReference|`getModelsWithoutGeoReference`]], clusters, the [[js:@bimworks/viewer3d/Viewer3dSettings#pointClouds|`pointClouds`]] setting.
- GIS: [[js:@bimworks/viewer3d/Viewer3d#getGisLayer|`getGisLayer`]], [[js:@bimworks/viewer3d/Viewer3d#getGisLayers|`getGisLayers`]], [[js:@bimworks/viewer3d/Viewer3d#setGisLayerOpacity|`setGisLayerOpacity`]], [[js:@bimworks/viewer3d/Viewer3d#removeGisLayer|`removeGisLayer`]], [[js:@bimworks/viewer3d/GisLayer#type|`UPLOADED_GIS`]], terrain options.
- Annotations: text mode, scaling by distance, limits, groups, annotation layers, [[js:@bimworks/viewer3d/Viewer3d#clearAnnotations|`clearAnnotations`]], [[js:@bimworks/viewer3d/Viewer3d#setAnnotationsVisible|`setAnnotationsVisible`]].
- Life cycle: [[js:@bimworks/viewer3d/Viewer3d#isRunning|`isRunning`]], [[js:@bimworks/viewer3d/Viewer3d#needsRepaint|`needsRepaint`]], repaint and engine-failure listeners, [[js:@bimworks/viewer3d/Viewer3d#getDiagnostics|`getDiagnostics`]], [[js:@bimworks/viewer3d/Viewer3d#showDiagnostics|`showDiagnostics`]], navigation-mode listeners, [[js:@bimworks/viewer3d/Viewer3d#usesPointerLock|`usesPointerLock`]], [[js:@bimworks/viewer3d/Viewer3d#isPointerLocked|`isPointerLocked`]], [[js:@bimworks/viewer3d/Viewer3d#isFullScreen|`isFullScreen`]], [[js:@bimworks/viewer3d/Viewer3d#saveScreenshot|`saveScreenshot`]], and the screenshot options [[js:@bimworks/viewer3d/ScreenshotOptions#width|`width`]], [[js:@bimworks/viewer3d/ScreenshotOptions#height|`height`]], [[js:@bimworks/viewer3d/ScreenshotOptions#viewpoint|`viewpoint`]], [[js:@bimworks/viewer3d/ScreenshotOptions#annotations|`annotations`]] and [[js:@bimworks/viewer3d/ScreenshotOptions#includeText|`includeText`]].
- The constructor's [[js:@bimworks/viewer3d/Viewer3d#constructor|`canvas`]] and [[js:@bimworks/viewer3d/Viewer3d#constructor|`container`]] arguments are declared; they existed at run time in 2.x.
