Build Your Next AR/VR Web App Using JavaScript

Kristen Carter
6 min readJul 3, 2019

--

Redefining user-experience with AR/VR web apps

Coming from a marginal market value of $6 Billion to reach up to the mark of $210 Billion in sales by 2022 the Augmented/Mixed/Virtual Reality trio has enjoyed fanatical growth since 2016.

VR and AR are two broad terms that allow users to both see, experience, and interact in a simulated environment. Both AR and VR are expected to have a massive impact on businesses through a variety of commercial, consumer, and enterprise applications. The following resources will also help you gain some insight into VR and AR web app development with JavaScript and HTML.

Introduction to Virtual Reality is a course by Udacity that focus on main VR platforms available today and give you important information on VR terms.

VR/AR Glossary Terms is the best place to learn about XR frameworks and 3D rendering. The VR Glossary available on their website will give you best info on the VR and AR terms and topics through infographics.

Not long ago, technologists predicted that AR/VR would change the way we do business by allowing entrepreneurs to track the progress of work, spot time, and investment before the foundation of your business is even poured.

The main goal of this post is to allow businesses to know how they enter the world of AR and VR quickly by building smart AR/VR applications on JavaScript and HTML. Hiring reliable developers can also help them to achieve success in the long run.

The reason? Today a lot of VR and AR app development goes on the web and this is where JavaScript rules. Whether you want to create a new AR application or add an AR view to an existing web application, the JavaScript provides a set of functions and utilities to your web application.

Getting to know the AR/VR web app development in JavaScript:

Before I begin, have a look at the several AR platforms such as Mozilla — aframe, Google — ArCode, Facebook — AR Studio & React 360, and Apple’s — ArKit. After knowing all these options, you can begin with the development of Augmented Reality project in a relatively easy manner. Also, begin by choosing AR web apps dev frameworks like React Naive, Vue Native, Cordova, and Ionic. You can also hire VR and AR developers to work on your project.

  1. Rendering 3D Graphics on Your VR and AR App

A-Frame

Now that you have a basic understanding of AR platforms, you can start looking at deploying 3D assets to your web app. The main framework of 3D development is A-Frame (supported by Mozilla) that enables rendering of 3D rich content in the browser without using plug-ins.

It is not just for adding 3D content, but it is also a powerful framework to develop VR content that supports features such as Windows mixed reality, declarative HTMLGearVR, Cardboard, Oculus Go, and can also be used for augmented reality. The A-Frame aims to define and go beyond the concept of 3D content and making full use of picture motion tracking and controllers.

2. Building VR Apps with A-Frame

Building VR web apps have never been easier. Add that power and accessibility of the web to your VR app with A-Frame. It is an excellent choice for building rich 3D experiences on the web. It’s built on top of three.js, advanced 3D JavaScript library that makes working with web apps extremely easy and fun. In my opinion, A-Frame gives you the best balance of adding 3D content to your web application. Sharing here some good resources to help you with your A-Frame journey:

Frame Academy An interactive A-Frame course where you can learn how to create 3D websites, web apps with coding basics.

A-Frame School The course provides you step-by-step exercises to help you learn about A-Frame.

3. A-Frame Libraries to Create AR Scenes

AR.js

You can use AR.js for building marker-based AR scenes. The tool comes with the A-Frame and the three.js extension that that works with any smartphone, regardless of its OS version.

Aframe-ar

The best way to build mobile AR application is to use ARCore for Android and ARKit for iOS. In order to use these SDK’s capabilities on the web, you can use two experimental apps released by Google including WebARonARCore and WebARonARKit that allow a JavaScript API to work on the aforementioned capabilities.

On top of that, Google also released three.ar.js library with three.js helper functions that support you building AR scenes. Aframe-ar was created to use A-Frame wrapper. It’s so easy to change your A-Frame scene tag from <a-scene> to <a-scene ar>.

Aframe-xr

Aframe-xr built on three.xr.js and they both are created by Mozilla. It supports the WebXR Device API by using the webxr-polyfill. The main use of aframe-xr is that it allow you to build progressive experiences on your device. In short, it allows you to choose and switch between AR and VR easily.

4. Adding Content to Your AR/VR Web App

We all know the value of adding quality content on the internet. This is also important in the process of creating web apps with XR and 3D experiences. While there is a lot of free and easy to use 3D app creation tools available, that’s why many of us start using existing content instead of creating the new content for the app. Today you can use two main tools for adding 3D assets to your AR/VR app.

Sketchfab

Sketchfab is a famous website to look for the latest 3D models that have over 2 million models to offer you. There are thousands of free models that are of usually high quality, and best to use for commercial purpose.

Google Poly

You can use Google Poly that has thousands of options to offer you for 3D models for building your VR and AR applications. You can use this tool for free, even for commercial purpose.

Both the options support multiple 3D formats, including glTF. You can choose the required format according to your business needs.

What Next?

I have covered all the aspects of AR and VR web app building on JavaScript, but there is still a lot of room for learning and optimization. Today business firms like to start adding augmented reality and virtual reality to their work and getting comfortable with it. For example, PS Vita puzzle game using a mirror and laser beam based on AR tech and they also have a lot of imaginative gaming apps. Something like this you could do with AR and VR like you can also build education apps, science-related apps, medical apps, travel apps, etc. So, I’m excited to see what you will do with AR and VR.

You can also hire developers from ValueCoders who has gained excellence in delivering AR/VR projects.

--

--

Kristen Carter

IT Software Consultant at ValueCoders.com. Been in this field for 8+ years while helping entrepreneurs make the best use of existing & emerging technologies.