It's been two years since I was heavily involved with WebVR at Mozilla but, despite not contributing every day, I can see VR making leaps and bounds, from Firefox making an increased effort to Chrome pushing VR and Oculus and HTC (Vive) improving their offerings. Native games are getting better but, more importantly, browsers are getting faster and three.js and aframe are empowering incredible VR experiences with JavaScript.
自从我在Mozilla大量参与WebVR以来已经有两年了,但是,尽管不是每天都在做贡献,但我可以看到VR取得了飞跃性发展,从Firefox到Chrome推动了VR和Oculus以及HTC(Vive)不断改进产品, 。 本机游戏越来越好,但更重要的是,浏览器越来越快,Three.js和aframe通过JavaScript带来了令人难以置信的VR体验。
Before you can serve up VR experiences, however, you need to ensure the browser supports VR experiences. To do so, you need to ensure navigator.getVRDisplays is available:
但是,在提供VR体验之前,需要确保浏览器支持VR体验。 为此,您需要确保navigator.getVRDisplays可用:
const supportsVR = 'getVRDisplays' in navigator; if (supportsVR) { navigator.getVRDisplays().then(function(displays) { // ... Load VR experience }); } else { // ... Show "you need {x} browser" message }If navigator.getVRDisplays is present, it's likely that the browser supports VR and AR experiences.
如果存在navigator.getVRDisplays ,则浏览器可能支持VR和AR体验。
Virtual reality and augmented reality have the potential to change the world and enrich lives. Learning how to code VR experiences will get you ahead of the curve, and as always, coding those experiences for the browser will break down the barrier of entry!
虚拟现实和增强现实具有改变世界和丰富生活的潜力。 学习如何编写VR体验代码将使您领先一步,并且一如既往地为浏览器编码这些体验将打破入门的障碍!
翻译自: https://davidwalsh.name/detect-webvr
相关资源:jdk-8u281-windows-x64.exe