W3cubDocs

/Web APIs

XRViewerPose: views property

The read-only XRViewerPose property views returns an array which contains every XRView which must be rendered in order to fully represent the scene from the viewpoint defined by the viewer pose. For monoscopic devices, this array contains a single view.

Warning: There is no guarantee that the number of views will remain constant over the lifetime of an XRSession. For each frame, you should always use the current length of this array rather than caching the value.

Stereo views require two views to render properly, with the left eye's view having its eye set to the string left and the right eye's view a value of right.

Value

An array of XRView objects, one for each view available as part of the scene for the current viewer pose. This array's length may potentially vary over the lifetime of the XRSession (for example, if the viewer enables or disables stereo mode on their XR output device).

Examples

See XRViewerPose for example code.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
views 79 79 No No 66 No No 79 No 57 No 11.2

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRViewerPose/views