getting started with web vr

34
Web VR Saurabh Badhwar mozilla Mozpacers

Upload: saurabh-badhwar

Post on 15-Apr-2017

92 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Getting Started with Web VR

Web VRSaurabh Badhwar

mozilla Mozpacers

Page 2: Getting Started with Web VR

What is VR?

Page 3: Getting Started with Web VR

Visual Immersion + Input Immersion

Page 4: Getting Started with Web VR

Visual Immersion

+

Page 5: Getting Started with Web VR

Input Immersion

Page 6: Getting Started with Web VR

So what is Web VR?

Page 7: Getting Started with Web VR

Render Web Content in VR

Access to Devices Being Used for VR

Device-agnostic VR in Web Browser

Focus on Head Mounted DisplaysAnd Sensor Devices

Page 8: Getting Started with Web VR

Web Content in VR

Page 9: Getting Started with Web VR

Focus on Visual Immersion

Support both Web GL and HTML/CSS Content

Page 10: Getting Started with Web VR

And the goals…

Allow High End Experience with VR in the Browser- Asm.js

- Emscripten- Game Engines

Allow Web Experience with VR- CSS 3D

- Responsive Sites- VR Browsing

Page 11: Getting Started with Web VR

Who supports Web VR

Page 12: Getting Started with Web VR

Web VR API

Page 13: Getting Started with Web VR

Basic Interface

Call getVRDevices() which returns a promise…

navigator.getVRDevices().then(vrDeviceCallBack);

The vrDeviceCallback() receives the list of all available VR Devices

function vrDeviceCallback(vrDevices) {//Some stuff here

}

Page 14: Getting Started with Web VR

VR Devices

For every VR Device

hardwareUnitIdUnique identifier per Hardware Device

deviceIdUnique ID for specific sensor/device on hardware

deviceNameUser-readable name identifying the sensor

Page 15: Getting Started with Web VR

Setting FOV

Configure the FOV that rendering device will use

setFieldOfView(left, right, znear, zfar)

Get the recommended and maximum FOV the device can render

getRecommendedEyeFieldOfView(whichEye)getMaximumEyeFieldOfView(whichEye)getCurrentEyeFieldOfView(whichEye)

Page 16: Getting Started with Web VR

Too much work to do?

Page 17: Getting Started with Web VR

Introducing A-Frame https://aframe.io

Page 18: Getting Started with Web VR

What is A-Frame?

Page 19: Getting Started with Web VR

A web framework for building VR Experiences

Page 20: Getting Started with Web VR

And It works on…

Page 21: Getting Started with Web VR

Let’s get started with A-Frame

Page 22: Getting Started with Web VR

Include the latest build in your Web Page

<script src="https://aframe.io/releases/0.3.2/aframe.min.js"></script>

Page 23: Getting Started with Web VR

Setting up the Scene

<a-scene> </a-scene>

Page 24: Getting Started with Web VR

Creating a Box

<a-box color=“617354” height=“10” width=“4” depth=“2” position=“-10 2 -5” rotation=“0 0 45” scale=“2 0.5 3”> </a-box>

Page 25: Getting Started with Web VR

Giving Box a Texture

<a-box color=“617354” height=“10” width=“4” depth=“2” position=“-10 2 -5” rotation=“0 0 45” scale=“2 0.5 3” src=“texture.png”> </a-box>

Page 26: Getting Started with Web VR

Leveraging Asset Management

<a-assets> </a-assets>

Page 27: Getting Started with Web VR

Adding Image Assets

<a-assets><img id=“img1” src=“logo.png”>

</a-assets>

Page 28: Getting Started with Web VR

Using Assets

<a-box color=“617354” height=“10” width=“4” depth=“2” position=“-10 2 -5” rotation=“0 0 45” scale=“2 0.5 3” src=“#img1”> </a-box>

Page 29: Getting Started with Web VR

Adding Animations

<a-animation attribute="rotation" repeat="indefinite" to="0 360 0">

</a-animation>

Page 30: Getting Started with Web VR

Adding Background

<a-sky color=“#73f7dd”></a-sky>

Page 31: Getting Started with Web VR

Adding Background Image

<a-sky src=“room.jpg”></a-sky>

Page 32: Getting Started with Web VR

Let’s add some music

<a-entity sound=“src: #bg-music; autoplay: true; volume: 10; loop: true”></a-entity>

Page 33: Getting Started with Web VR

Where to head next

A-Frame Website: https://aframe.io

MozVR: https://mozvr.com

Web VR Slack channel: https://webvr-slack.herokuapp.com

Page 34: Getting Started with Web VR

Thank you!

Reach out to us at:

E-Mail: [email protected]: fb.me/mozpacers

Twitter: @mozpacers