How to add Virtual Reality capabilities to your app?
We need to add an environment and create an XR Experience. This will automaticly add a button to our scene to go into VR mode.
const env = scene.createDefaultEnvironment();
const xr = await scene.createDefaultXRExperienceAsync({
floorMeshes: [env.ground]
});We can also add the WebXR directly to a loaded model without an environment.
PreviousHow to add WebXR support?NextHow to test your WebXR app on an Android phone or Google Cardboard?
Last updated
Was this helpful?
