XRCubeLayer: orientation 屬性
XRCubeLayer 介面的 orientation 屬性表示相對於 space 屬性的方向。
值
一個 DOMPointReadOnly。
示例
更新立方體圖層的方向
XRWebGLBinding.createCubeLayer() 方法會建立一個立方體圖層,並允許指定一個 orientation。在圖層建立後,可以使用 XRCubeLayer.orientation 屬性來獲取當前方向或將其設定為新的方向。
js
const cubeLayer = xrGlBinding.createCubeLayer({
space: xrReferenceSpace,
viewPixelWidth: 512,
viewPixelHeight: 512,
orientation: DOMPointReadOnly.fromPoint({ x: 0.0, y: 0.0, z: 0.0, w: 1.0 }),
});
cubeLayer.orientation = someOtherPoint;
規範
| 規範 |
|---|
| WebXR Layers API Level 1 # dom-xrcubelayer-orientation |
瀏覽器相容性
載入中…