Hello VR World: 
How to Build an Oculus App in Under 5 minutes

Hello VR World: How to Build an Oculus App in Under 5 minutes


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

  1. Make sure your Oculus and your laptop are connected to the same WiFi network
  2. Create a python server with the following command: python3 -m http.server
  3. On your Oculus Browser, go to your `<IP address>:<port>`.?
  4. 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:
  5. “Access this site over HTTPS to enter VR mode and grant access to the device sensors”.??

  • Test on a HTTPS server

  1. I tried playing around with port forwarding, and creating an https-server using npm, but, ultimately,?
  2. It was fastest to push my changes to my GitHub repo, and publish on GitHub Pages .
  3. 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!

Elena Arzamas

Search Engine Optimization Team Lead – Kolos Digital

1 年

Amrutha, thanks for sharing!

回复
Adrien Piérard

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!

Kyle Johnson

Cofounder of [Ara, Tidewater, R3] | ex-Facebook data science

2 年

The question is, how much can you make selling it as an NFT? :p

回复
Nancy Mahlen, Ph.D., M.Ed.

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!

回复

要查看或添加评论,请登录

Amrutha Gujjar的更多文章

社区洞察

其他会员也浏览了