XREquirectLayer: upperVerticalAngle 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.

Thuộc tính upperVerticalAngle của giao diện XREquirectLayer đại diện cho góc dọc trên tính bằng radian cho hình cầu.

Giá trị

Một số đại diện cho góc dọc trên tính bằng radian cho hình cầu. Đặt upperVerticalAngle thành giá trị nhỏ hơn -π/2 sẽ đặt nó thành -π/2 và đặt thành giá trị lớn hơn π/2 sẽ đặt nó thành π/2.

Ví dụ

Lấy góc dọc trên của một lớp

Phương thức XRWebGLBinding.createEquirectLayer() tạo một lớp equirect và cho phép chỉ định upperVerticalAngle. Thuộc tính XREquirectLayer.upperVerticalAngle có thể được sử dụng sau khi tạo lớp để lấy góc dọc trên đã sử dụng hoặc đặt nó thành một giá trị mới.

js
const equirectLayer = xrGlBinding.createEquirectLayer({
  space: xrReferenceSpace,
  viewPixelWidth: 1200,
  viewPixelHeight: 600,
  centralHorizontalAngle: 2 * Math.PI,
  upperVerticalAngle: Math.PI / 2.0,
  lowerVerticalAngle: -Math.PI / 2.0,
  radius: 0,
});

equirectLayer.upperVerticalAngle; // 1.5707963267948966

Thông số kỹ thuật

Specification
WebXR Layers API Level 1
# dom-xrequirectlayer-upperverticalangle

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

Xem thêm