XRDepthInformation:normDepthBufferFromNormView 属性
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
XRDepthInformation 接口的 normDepthBufferFromNormView 只读属性返回在索引深度缓冲区时需要应用的 3D 几何变换。
值
在索引深度缓冲区时需要应用的 XRRigidTransform。该矩阵所表示的变换将坐标系从归一化视图坐标转换为归一化深度缓冲区坐标,然后可通过深度缓冲区的 width 和 height 缩放以获得绝对深度缓冲区坐标。
示例
使用 XRFrame.getDepthInformation()(CPU)或 XRWebGLBinding.getDepthInformation()(WebGL)获取深度信息。返回的对象将包含深度缓冲区的 normDepthBufferFromNormView,可用于进一步计算。
js
const normDepthFromNormViewMatrix =
depthData.normDepthBufferFromNormView.matrix;
const normViewFromNormDepth =
depthData.normDepthBufferFromNormView.inverse.matrix;
规范
| Specification |
|---|
| WebXR Depth Sensing Module> # dom-xrdepthinformation-normdepthbufferfromnormview> |
浏览器兼容性
Loading…