AR and VR Using the WebXR API: Learn to Create Immersive Content with WebGL, Three.js, and A-Frame

  • 3h 38m
  • Rakesh Baruah
  • Apress
  • 2021

Gain an in-depth knowledge in immersive web development to create augmented reality (AR) and virtual reality (VR) applications inside web browsers using WebXR API, WebGL, Three.js, and A-Frame. This project-based book will provide the practice and portfolio content to make the most of what the futures of spatial computing and immersive technology have to offer.

Beginning with technical analysis of how web browsers function, the book covers programming languages such as WebGL, JavaScript, and HTML, with an eye on a complete understanding of the WebXR lifecycle. You'll then explore how contemporary web browsers work at the code level and see how to set up a local development server and use it with the Visual Studio Code IDE to create 3D animation in the WebGL programming language.

With a familiarity of the web-rendering pipeline in place, you’ll venture on to WebGL abstractions such as the Three.js JavaScript library and Mozilla’s A-Frame XR Framework, which use WebXR to create high-end visual effects. In the final projects of the book, you’ll create an augmented reality web session for an Android phone device, and create a VR scene in A-Frame (built on Three.js) to demo essential components of the WebXR API pertaining to user positioning and interaction.

Game engines have become common-place for the creation of mixed reality content. However, developers not interested in learning entirely new workflows may be better suited to work within a medium almost universally open to all―the web; AR and VR Using the WebXR API will show you the way.

What You'll Learn

  • Master the creation of virtual reality and augmented reality features for web page
  • Prepare to work as an immersive web developer with a portfolio of projects in sought-after technologies
  • Review the fundamentals of writing shaders in WebGL
  • Experience the unity between client, server, and cloud architecture as it applies to location-based AR

Who This Book Is For

Aspiring immersive web developers and developers already familiar with the fundamentals of web development who want to further explore topics such as spatial computing, computer vision, spatial anchors, and cloud-computing for multi-user social experiences.

About the Author

Rakesh Baruah is a writer and creator with 15 years of experience in new media, film, and television in New York City. After completing an MFA in screenwriting and directing for film from Columbia University, Rakesh joined the writers’ room of a hit, primetime, network drama as an assistant. The experience opened his eyes to the limits of television and the opportunities promised by 3D, immersive content. In 2016 he began a self-guided journey toward mixed reality design that has taken him through startups, bootcamps, the Microsoft offices, and many, many hours in front of a computer. He is the author of one previous book on virtual reality and the Unity Game Engine and has received an Nvidia-certified nanodegree in Computer Vision. He shares what he’s learned with you in a style and format designed specifically for the person who, in high school, preferred English class to Trigonometry.

In this Book

  • Getting Started
  • Up and Running with WebGL
  • Toward the Third Dimension in WebGL
  • Matrices, Transformations, and Perspective in WebGL
  • Diving into Three.js
  • Entering VR Through WebXR
  • Creating an Augmented Reality Website with Three.js and the WebXR API
  • Building VR for the Web with A-Frame
  • Physics and User Interaction in A-Frame
  • Deploying 3D Animated Models in AR with A-Frame and GitHub Pages