WebXR Device API
XRDepthInformation 接口的 width 只读属性包含深度缓冲区的宽度(列数)。
值
无符号长整型。
示例
使用 XRFrame.getDepthInformation()(CPU)或 XRWebGLBinding.getDepthInformation()(WebGL)获取深度信息。返回的对象将包含深度缓冲区的 width,可用于进一步的计算。
const smallerDepthDimension = Math.min(depthInfo.width, depthInfo.height);
const largerDepthDimension = Math.max(depthInfo.width, depthInfo.height);
规范
浏览器兼容性
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
