There are few changes we need to make to turn our experience into a VR experience.
Import VR button into your scene.
import { VRButton } from "/jsm/webxr/VRButton";
Enable XR on renderer.
Append the VRButton to your html body.
renderer.xr.enabled = true; document.body.appendChild(VRButton.createButton(renderer));
In your animate function, replace requestAnimationFrame to :
renderer.setAnimationLoop(animate);
If you are on an iOS
Last updated 5 years ago
Was this helpful?