This is the code sample of WebXR and three.js integration. Wroks on Android ARCore supported devices with Chrome 81+
Running instructions:
-
Download three.js srouce code and place it under
three.js
subdirectory. OR if you don't want to download the full source code:- Download GLTFLoader.js and place it under
three.js/examples/jsm/loaders/
- Download three.module.js and place it under
three.js/build/
- Download GLTFLoader.js and place it under
-
Install
npm
-
Generate self-signed certificates
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
-
Initialize project
npm init -y && npm install node-static
-
Start the server
npm start
-
Make sure your smartphone is connected to the same network as your PC, open Chrome and navigate to https://your_local_ip:3000/webxr-threejs.html