XRDepthInformation: height property
Khả dụng hạn chế
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 height của giao diện XRDepthInformation chứa chiều cao của bộ đệm độ sâu (số hàng).
Giá trị
Một số nguyên không dấu.
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 height của bộ đệm độ sâu, bạn có thể sử dụng để tính toán thêm.
js
const smallerDepthDimension = Math.min(depthInfo.width, depthInfo.height);
const largerDepthDimension = Math.max(depthInfo.width, depthInfo.height);
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| WebXR Depth Sensing Module> # dom-xrdepthinformation-height> |