WebXR Device API
XRDepthInformation 接口的 normDepthBufferFromNormView 只读属性返回在索引深度缓冲区时需要应用的 3D 几何变换。
值
在索引深度缓冲区时需要应用的 XRRigidTransform。该矩阵所表示的变换将坐标系从归一化视图坐标转换为归一化深度缓冲区坐标,然后可通过深度缓冲区的 width 和 height 缩放以获得绝对深度缓冲区坐标。
示例
使用 XRFrame.getDepthInformation()(CPU)或 XRWebGLBinding.getDepthInformation()(WebGL)获取深度信息。返回的对象将包含深度缓冲区的 normDepthBufferFromNormView,可用于进一步计算。
const normDepthFromNormViewMatrix =
depthData.normDepthBufferFromNormView.matrix;
const normViewFromNormDepth =
depthData.normDepthBufferFromNormView.inverse.matrix;
规范
浏览器兼容性
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
