How to enable VR?
There are few changes we need to make to turn our experience into a VR experience.
  • Import VR button into your scene.
1
import { VRButton } from "/jsm/webxr/VRButton";
Copied!
  • Enable XR on renderer.
  • Append the VRButton to your html body.
1
renderer.xr.enabled = true;
2
document.body.appendChild(VRButton.createButton(renderer));
3
​
Copied!
  • In your animate function, replace requestAnimationFrame to :
    1
    renderer.setAnimationLoop(animate);
    Copied!

Run the VR experience on your phone

If you are on an iOS
​
Export as PDF
Copy link