navigator.xr.requestSession("immersive-ar", {
requireFeatures: ["anchors"],
});XRAnchor / notebook
XRAnchor
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
frame.createAnchor(anchorPose, referenceSpace).then(
(anchor) => {
// Do stuff with the anchor (assign objects that will be relative to this anchor)
},
(error) => {
console.error(`Could not create anchor: ${error}`);
},
);