<html>
<body>
<canvas id="three-canvas"></canvas>
<div id="hud">
<button>Will be visible in ar</button>
</div>
</body>
</html>
js const xrSession = await window.navigator.xr.requestSession('immersive-ar', {
// ...requiredFeatures,
domOverlay: {
root: $('#hud'),
},
})
css #three-canvas {
z-index: 999;
}
#hud {
z-index: 1000;
}
edit: use window.navigator instead of W.NAV, my custom "window" global. const => {
const { innerWidth: w, innerHeight: h } = window
camera.aspect = w / h
camera.updateProjectionMatrix()
renderer.setSize(w, h)
}
window.addEventListener('resize', onResize)
Competition is only cooperation's favorite strategy.
(By choosing from competing groups we select more favorable cooperation partners, because there are too many to choose from.)
Both of our statements are true. darned doublethink.