๐
๐
๐
๐
Azure Mixed Reality Docs
Searchโฆ
Azure Mixed Reality Curriculum
What is the Metaverse?
Unity Lessons
WebXR Lessons
3D on the Web
WebXR Device APIs
Concepts
Project
How to enable VR?
How to enable AR and Hit-test?
How to debug and test your WebXR Application with Chrome Dev Tools?
How to load a 3D Model
Resources
What could go wrong?
A-Frame
Three.js
Babylon.js
WebXR Meetups
Resources
Unreal Engine Lessons
Artificial Intelligence(AI) Lessons
Exercises
FAQ
Glossary
How to contribute?
Powered By
GitBook
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
โ
Previous
Project
Next
How to enable AR and Hit-test?
Last modified
1yr ago
Export as PDF
Copy link
Contents
Run the VR experience on your phone