Hi,
I am trying to add a babylon scene to an xr session based on the beginning of this blog https://www.devbridge.com/articles/ar-app-development-tutorial/
I currently have an enter xr button and the babylon scene renders before entering the session (using node https & api emulator extension). If anyone has any tips for rendering the scene once the xr session is active, I would greatly appreciate it. I would also like to render an overlay/holographic slate of a 3d object only once the immersive xr session is activated (posted about this earlier, sorry for the repeat!).
I tried creating a javascript function and adding in the babylon scene and calling it with session.addEventListener(‘scene’, babylonjs); in the onsessionstartedfunction however, cannot get the scene to display. Below is an image of the output with the babylon 3d images at the bottom of my html file in no function call.
Thank you all for your help!
I don’t have any errors with the babylon scene in a function but get the following message in the console
"Added non-passive event listener to a scroll-blocking ‘touchmove’ event. Consider marking event handler as ‘passive’ to make the page more responsive. See Passive event listeners - Chrome Platform Status
TransformControls @ …
_init @ …
ARScene @ …
requestSession @ …
requestSession @ …
CustomWebXRPolyfill.XRSystem.requestSession @ …
onButtonClicked @ (index):64
(index):62 [Violation] ‘click’ handler took 198ms
[Violation] ‘requestAnimationFrame’ handler took 64ms
is it possible that I am trying to request 2 immersive sessions simultaneously and there is a more effective approach?
my start function:
function onSessionStarted(session) {
xrSession = session;
xrButton.innerHTML = ‘Exit AR’;
session.addEventListener(‘bb’, babylonjs);
session.addEventListener(‘end’, onSessionEnded);