Back to Content

XRCylinderLayer: transform property

files/en-us/web/api/xrcylinderlayer/transform/index.md

latest801 B
Original Source

{{APIRef("WebXR Device API")}}{{SeeCompatTable}}

The transform property of the {{domxref("XRCylinderLayer")}} interface represents the offset and orientation relative to the layer's {{domxref("XRCylinderLayer.space", "space")}}.

Value

An {{domxref("XRRigidTransform")}}.

Examples

Setting the cylinder layer's position

This example code positions the layer two meters away from the origin of xrReferenceSpace.

js
const cylinderLayer = xrGlBinding.createCylinderLayer({
  space: xrReferenceSpace,
  viewPixelWidth: 512,
  viewPixelHeight: 512,
});

cylinderLayer.transform = new XRRigidTransform({ z: -2 });

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("XRRigidTransform")}}
  • {{domxref("XRCylinderLayer.space")}}