XRDepthInformation: width 屬性
XRDepthInformation 介面的只讀 width 屬性包含深度緩衝區的寬度(列數)。
值
無符號長整型。
示例
使用 XRFrame.getDepthInformation() (CPU) 或 XRWebGLBinding.getDepthInformation() (WebGL) 來獲取深度資訊。返回的物件將包含深度緩衝區的 width,您可以使用它進行進一步的計算。
js
const smallerDepthDimension = Math.min(depthInfo.width, depthInfo.height);
const largerDepthDimension = Math.max(depthInfo.width, depthInfo.height);
規範
| 規範 |
|---|
| WebXR Depth Sensing 模組 # dom-xrdepthinformation-width |
瀏覽器相容性
載入中…