XRDepthInformation: normDepthBufferFromNormView property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Thuộc tính chỉ đọc normDepthBufferFromNormView của giao diện XRDepthInformation chứa phép biến đổi hình học 3D cần được áp dụng khi lập chỉ mục vào bộ đệm độ sâu.

Giá trị

Một XRRigidTransform cần được áp dụng khi lập chỉ mục vào bộ đệm độ sâu. Phép biến đổi mà ma trận biểu diễn thay đổi hệ tọa độ từ tọa độ khung nhìn chuẩn hóa sang tọa độ bộ đệm độ sâu chuẩn hóa, sau đó có thể được chia tỷ lệ theo widthheight của bộ đệm độ sâu để có được tọa độ bộ đệm độ sâu tuyệt đối.

Ví dụ

Sử dụng XRFrame.getDepthInformation() (CPU) hoặc XRWebGLBinding.getDepthInformation() (WebGL) để lấy thông tin độ sâu. Các đối tượng được trả về sẽ chứa normDepthBufferFromNormView của bộ đệm độ sâu, bạn có thể sử dụng để tính toán thêm.

js
const normDepthFromNormViewMatrix =
  depthData.normDepthBufferFromNormView.matrix;
const normViewFromNormDepth =
  depthData.normDepthBufferFromNormView.inverse.matrix;

Thông số kỹ thuật

Specification
WebXR Depth Sensing Module
# dom-xrdepthinformation-normdepthbufferfromnormview

Tương thích trình duyệt