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