How to run sample Threejs VR project using local server?

♀尐吖头ヾ 提交于 2019-12-24 12:13:00

问题


I am trying to run sample threejs project for VR using xampp local server in Samsung NOTE 4 device.In this phone, online threejs VR examples(https://threejs.org/examples/?q=vr#webvr_cubes) working fine,

but same example in our local server link(http://192.168.1.2/three.js-dev/examples/?q=vr#webvr_cubes) always returns "Your browser does not support WebVR".

Can any one give me suggestions or idea how to run that sample project using xampp local server

Thanks in Advance


回答1:


At this time, WebVR is still an experimental feature (I assume you're using Chrome).

http://192.168.1.2/ is not seen as a trusted entity, hence experimental features are disabled.
However http://127.0.0.1 and https://threejs.org are allowed to use this feature.

To enable WebVR, go to chrome://flags/#enable-webvr and click Enable


If you want your users to be able to use WebVR today, you have to apply for Origin Trials by filling in this form. Google will give you a token to add on your page. (Note that you will have to set up HTTPS on your server).

Alternatively, you can add a polyfill to make your VR work everywhere (not just in Chrome M59+).
(just include the polyfill before three.js)



来源:https://stackoverflow.com/questions/45234758/how-to-run-sample-threejs-vr-project-using-local-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!