Skip to content

siddheshgunjal/html_surface_tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

World tracking on Web with WebXR

This is a demo implementation of WebXR Device API. Purpose of this project is to showcase how we can develop XR application for web browsers using WebXR. This project showcases implementation of Hit-test to find out vertical and horizontal plains and initiate 3D geometry.

Table of contents

What is Extended Reality

Extended reality (XR) is an umbrella term to refer to Augmented reality (AR), Virtual reality (VR), and Mixed reality (MR). The technology is intended to combine or mirror the physical world with a "digital twin world" able to interact with it, giving users an immersive experience by being in a virtual or augmented environment.

Extended Reality (XR) Explained

XR is not limited to just these three categories and can emcompass other technologies and variations as well. The key concept behind XR is the blending of physical and digital experiences to create immersive and interactive environments. XR has applications in various industries, including gaming, education, helathcare, architecture, engineering and entertainment.

What is WebXR

WebXR is an API for web content and apps to use to interface with mixed reality hardware such as VR headsets and glasses with integrated augmented reality features. This includes both managing the process of rendering the views needed to simulate the 3D experience and the ability to sense the movement of the headset (or other motion-sensing gear) and provide the needed data to update the imagery shown to the user.

WebXR additionally provides support for accepting inputs from control devices such as handheld VR controllers or specialized mixed reality gamepads.

WebXR is not a rendering technology and does not provide features for managing 3D data or rendering it to the display. This is an important fact to keep in mind. While WebXR manages the timing, scheduling, and the various points of view relevant when drawing the scene, it does not know how to load and manage models, nor how to render and texture them, and so forth. That part is entirely up to you. Fortunately, WebGL and the various WebGL-based frameworks and libraries are available to make it much easier to deal with all of that.

How to run this Project on your local machine

In order to run the WebXR Device API we need https. To the test/debug WebXR applications, the simplest method is to host your local server over https over ngrok. Follow below steps to run this project:

Clone this repo git clone https://github.com/siddheshgunjal/html_surface_tracking.git

Go into the repo cd html_surface_tracking

Run app in local server using any means (I chose python) python -m http.server 4345

Host your local server over https using ngrok ngrok http 4345

Now visit the https url from your hand-held device

How to use your 3D model

Prerequisite

You'll need 3D model in .glb format

changes in app.js

  • Put your 3D model into ./assets folder.

  • line 110: change the name of your 3D model

  • line 117-line 127: change the default settings of your model like default animation clips, animation speed, etc.

  • line 133: scale of your 3D model.

  • line 207-line 211: animations to trigger for respective gestures.

changes in libs/Player.js

  • line 106: change walking animation clip name.

  • line 155 & line 185: change default animation clip name.

Objectives

  • Detect if XR capabilities are available

  • Query the XR device capabilities

  • Scan and detect nearby vertical and horizontal planes

  • Spawn 3D object on the detected surface

  • Control the 3D object with Gestures

  • Relocate 3D model with animation withing same XRSession

Support ✨

If you get stuck, we’re here to help. The following are the best ways to get assistance working through your issue:

  • Use our Github Issue Tracker for reporting bugs or requesting features. Contribution are the best way to keep thos project amazing 💪

Maintainer 😎

Static Badge

About

World tracking implementation for web using WebXR Device API

Resources

License

Stars

Watchers

Forks