Examples » WebVR

Basic WebVR application.


This example is a basic demonstration of how to use the Emscripten VR API with Magnum.

For the full experience, this example requires a WebVR 1.1 capable browser and a VR headset. You may need to enable WebVR support explicitly on your browser — on Chrome go into chrome://flags and search for WebVR. Works on Android as well.

Note that there is also a Oculus VR example and a Leap Motion example.


  • Mouse click — enter VR
  • Esc — exit VR


This example was originally contributed by Jonathan Hale.


Full source code is linked below and together with assets also available in the magnum-examples GitHub repository. This example uses the Platform::EmscriptenApplication which is not enabled by default in all cases, see its documentation for usage instructions.