I was feeling hacky today, so I decided to pick up my Quest 2 and see how quickly I could build a simple VR app. Here’s how far I could get in 5 minutes:
You’ll need: A Meta Quest 2 Device, VSCode, GitHub??
- Make sure your Oculus device is charged and up-to-date
- Go to your Oculus Settings and ensure Developer Mode is toggled to ‘ON’?
- We can use AFrame for declaring a few static 3D objects in our scene.?
- AFrame
is a declarative, open-source WebVR framework built on top of three.js
- Create a new GitHub repository, and create an index.html page with a few AFrame entities. You can declare simple 3D shapes like this:?
?<a-entity id="sphere" geometry="primitive: sphere; radius: 1.25" material="color: #EF2D5E" position="0 1.25 -5"></a-entity>
- I found a great set of AFrame examples in a GitHub repo by Lee Stemkoski. To start with, I used the contents of dice.html
.?
- To see your changes on the Oculus device, you can:
- Test locally
- Make sure your Oculus and your laptop are connected to the same WiFi network
- Create a python server with the following command: python3 -m http.server
- On your Oculus Browser, go to your `<IP address>:<port>`.?
- The drawback to local testing is that you won’t have access to the full VR experience without access to the device sensors, which are only accessible through HTTPS. I got the following message during local testing:
- “Access this site over HTTPS to enter VR mode and grant access to the device sensors”.??
- I tried playing around with port forwarding, and creating an https-server
using npm, but, ultimately,?
- It was fastest to push my changes to my GitHub repo, and publish on GitHub Pages
.
- My starter app is hosted here: https://amrutha97.github.io/GoMonkey/dice.html
.?
And there we go! Hello VR World! I attached is a short screencast of what my WebVR page looks like from my Oculus browser. I was pleasantly surprised by how quick and easy it was to build for the Oculus Browser – and I look forward to using this to hack together a few fun side projects! Stay tuned!
Search Engine Optimization Team Lead – Kolos Digital
1 年Amrutha, thanks for sharing!
Ph.D., Neuromotor Interfaces at Meta's Reality Labs. Sending a connection request? Please add a note saying why.
2 年Wow. It still takes me an hour to make the simplest Android phone app :D P!
Cofounder of [Ara, Tidewater, R3] | ex-Facebook data science
2 年The question is, how much can you make selling it as an NFT? :p
Cybersecurity Professional | Open to New Opportunities in Cybersecurity
2 年Awesome! We’re teaching K-12 kids with the Quest 2 - might pick your brain on this, Amrutha! Would love to see more on this!