SlideShare a Scribd company logo
1 of 25
Download to read offline
Quick dive into WebVR
Janne Aukia — 27 Oct 2016
Image: a french glass stereo-view depicting riverside natural swimming pool in the Seine 

at Valvins, Fontainebleau. Taken in 1926. Scanned by James Morley. flic.kr/p/9dZuyB
Oculus rift by Musavvir Ahmed from the Noun Project.

thenounproject.com/term/oculus-rift/165712
I’m a UX designer / JS dev with
interest in VR, data visualisation and
machine learning. I work with startups
and agile teams.
About me
My interest in VR 1/2
Sega 3d shutter glasses

around year 1990
(connected to Mac by a serial connector.
connector design + demo software by a 

Finn called Juri Munkki)
My interest in VR 2/2
VR Cave at Otaniemi TML lab

in year 2005
High-fi: HTC Vive, Oculus Rift,
Playstation VR
Low-fi: Google Daydream,
Samsung Gear VR, Google Cardboard
(AR: Microsoft Hololens)
VR Devices 1/2
Icons by Arthur Schmitt from the Noun Project.

thenounproject.com/tart2000/collection/virtual-reality-vr-headsets
VR Devices 2/2
Images by Mozilla Contributors.

https://developer.mozilla.org/en-US/docs/Web/API/WebVR_API/WebVR_concepts
Unreal Engine (C++)
Unity (C#)
WebVR (JS)
VR Programming
“Always bet on JS” — Brendan Eich
WebVR
WebVR is an experimental JavaScript
API that provides access to Virtual
Reality devices in a browser.
A W3C Community Group spec on the way
to standardization.
WebGL + pose tracking + stereoscopic
rendering + vr controllers
WebVR: browsers
WebVR being developed for Chrome,
Firefox, IE Edge and Samsung Internet
Browser. Facebook is making a WebVR
browser for Oculus as well.
HTC Vive supported only in experimental
Chrome builds and Firefox nightly.
More info: https://hacks.mozilla.org/2016/03/
introducing-the-webvr-1-0-api-proposal/
Exciting times: WebVR API, tools, browsers
and hardware are in a state of constant flux.
Photo by Michelle Tribe.

flic.kr/p/8onKq9
WebVR: how to start
Starting point: webvr.info
High-fi: Experimental Chrome + HTC
Vive + Windows
Low-fi: Samsung Gear VR or similar. Or
a mobile phone + WebVR polyfill. Or
build a native app with CocoonJS etc.
1. Query for VR displays
2. Present to the VR display
3. Render
4. Input VR controllers (gamepad API)
WebVR API overview
https://iswebvrready.org/
WebVR API: rendering
navigator.getVRDisplays().then(function(displays)	{	
		if	(!displays.length)	return;	
		vrDisplay	=	displays.length[0];	
}).catch(function	(err)	{	
		console.error('Could	not	get	VRDisplays',	err.stack);	
});	
//	WebVR	introduces	a	special,	over	60FPS	version,	
//	of	the	requestAnimationFrame!	
vrDisplay.requestAnimationFrame(loop);	
function	loop()	{	
		//	set	up	for	the	next	frame	
		vrDisplay.requestAnimationFrame(loop);	
		//	get	HMD	position/orientation	
		var	pose	=	vrDisplay.getPose();	
		if(vrDisplay.isPresenting)	{	
				//	render	scene	for	each	eye	
				renderScene(pose,	"left");	
				renderScene(pose,	"right");	
		}	
		vrDisplay.submitFrame(pose);	
}
• Three.js (and Babylon.js, Scene.js)
• A-Frame (and GLAM, SceneVR)
• ReactVR coming
• Exporting from Unity/Unreal via
Emscripten
• Vizor in-browser VR development,
SocialVR
JS libraries, frameworks
and authoring tools
• Does a lot of things for you while
providing access to WebGL details
• Simple setup of VR scene and rendering
• Supports Vive controllers
• Examples at: threejs.org/examples/
• WebVR boilerplate at: github.com/
borismus/webvr-boilerplate
Three.js for WebVR
Three.js example 1/2
//	Before	these,	setup	manager	and	renderer,	see:	
//	https://github.com/borismus/webvr-boilerplate/blob/master/index.html	
var	scene	=	new	THREE.Scene();	
var	camera	=	new	THREE.PerspectiveCamera(75,	

				window.innerWidth/window.innerHeight,	0.1,	100);	
var	controls	=	new	THREE.VRControls(camera);	
controls.standing	=	true;	
//	Apply	VR	stereo	rendering	to	renderer.	
var	effect	=	new	THREE.VREffect(renderer);	
effect.setSize(window.innerWidth,	window.innerHeight);	
var	geometry	=	new	THREE.BoxGeometry(0.5,	0.5,	0.5);	
var	cube	=	new	THREE.Mesh(geometry,	new	THREE.MeshNormalMaterial());	
//	Position	cube	mesh	to	be	right	in	front	of	you.	
cube.position.set(0,	controls.userHeight,	-1);	
//	Add	cube	mesh	to	your	three.js	scene	
scene.add(cube);
Three.js example 2/2
//	Request	animation	frame	loop	function	
var	lastRender	=	0;	
vrDisplay.requestAnimationFrame(animate);	
function	animate(timestamp)	{	
		var	delta	=	Math.min(timestamp	-	lastRender,	500);	
		lastRender	=	timestamp;	
			
		//	Apply	rotation	to	cube	mesh	
		cube.rotation.y	+=	delta	*	0.0006;	
		controls.update();	
			
		//	Render	the	scene	through	the	manager.	
		manager.render(scene,	camera,	timestamp);	
		effect.render(scene,	camera);	
		vrDisplay.requestAnimationFrame(animate);	
}
• WebVR emulator for Chrome might also come
in handy, find it at: https://webvr.info/
• Ray Input is a JavaScript library that
provides an input abstraction for interacting
with 3D VR content in the browser: https://
github.com/borismus/ray-input
• WebVR replayer for Vive controller
simulation/testing https://github.com/
mrdoob/webvr-replayer
Practical tools
My toy project (coloring book)
Thanks to Paja @ the Iso Omena Library 

for letting me use their Vive setup!
Other demos / material.
• Make libs for three.js, components for
a-frame
• Map data vis + 3d cities
• UI components: menus, dialogs,
canvases, portals
• Procedural worlds, simulators
• Skeumorphic UIs, abstract UIs
• Music tools, video editors, photo
browsers
Go create!

More Related Content

Viewers also liked

Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
FITC
 

Viewers also liked (19)

Introduction to The VR Web
Introduction to The VR WebIntroduction to The VR Web
Introduction to The VR Web
 
20160713 webvr
20160713 webvr20160713 webvr
20160713 webvr
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
 
JavaScript and Web Standards Sitting in a Tree
JavaScript and Web Standards Sitting in a TreeJavaScript and Web Standards Sitting in a Tree
JavaScript and Web Standards Sitting in a Tree
 
Photo and photo
Photo and photoPhoto and photo
Photo and photo
 
Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++
 
WebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitWebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC Summit
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVR
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVR
 
WebRTC on Mobile Devices: Challenges and Opportunities
WebRTC on Mobile Devices: Challenges and OpportunitiesWebRTC on Mobile Devices: Challenges and Opportunities
WebRTC on Mobile Devices: Challenges and Opportunities
 
WebVR
WebVRWebVR
WebVR
 
WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016
 
An Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsAn Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 seconds
 
TDC2016POA | Trilha Web - Realidade Virtual com WebVR
TDC2016POA | Trilha Web -  Realidade Virtual com WebVRTDC2016POA | Trilha Web -  Realidade Virtual com WebVR
TDC2016POA | Trilha Web - Realidade Virtual com WebVR
 
How to create 360 Image/panorama & share with WebVR?
How to create  360 Image/panorama & share with WebVR?How to create  360 Image/panorama & share with WebVR?
How to create 360 Image/panorama & share with WebVR?
 
Baby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC TutorialBaby Steps: A WebRTC Tutorial
Baby Steps: A WebRTC Tutorial
 
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
 
WebGL, WebVR and the Metaverse
WebGL, WebVR and the MetaverseWebGL, WebVR and the Metaverse
WebGL, WebVR and the Metaverse
 

Similar to Quick dive into WebVR

Similar to Quick dive into WebVR (20)

Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive Web
 
Easy Virtual Reality
Easy Virtual RealityEasy Virtual Reality
Easy Virtual Reality
 
Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5
 
Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017
 
Mobile Day - WebVR
Mobile Day - WebVRMobile Day - WebVR
Mobile Day - WebVR
 
WebVR: Developing for the Immersive Web
WebVR: Developing for the Immersive WebWebVR: Developing for the Immersive Web
WebVR: Developing for the Immersive Web
 
VR digest. July 2017
VR digest. July 2017VR digest. July 2017
VR digest. July 2017
 
Unleash 3D games with Babylon.js - JSConf 2014 talk
Unleash 3D games with Babylon.js - JSConf 2014 talkUnleash 3D games with Babylon.js - JSConf 2014 talk
Unleash 3D games with Babylon.js - JSConf 2014 talk
 
Турський Віктор “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...
Турський Віктор  “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...Турський Віктор  “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...
Турський Віктор “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...
 
Getting started with Unity and AR/VR for the .NET developer... Reloaded!
Getting started with Unity and AR/VR for the .NET developer... Reloaded!Getting started with Unity and AR/VR for the .NET developer... Reloaded!
Getting started with Unity and AR/VR for the .NET developer... Reloaded!
 
VR digest. January 2018
VR digest. January 2018VR digest. January 2018
VR digest. January 2018
 
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
 
Web based virtual reality - Tanay Pant, Mozilla
Web based virtual reality - Tanay Pant, MozillaWeb based virtual reality - Tanay Pant, Mozilla
Web based virtual reality - Tanay Pant, Mozilla
 
"Getting started with Web Based Virtual Reality" Pant Tanay, Mozilla Foundation
"Getting started with Web Based Virtual Reality" Pant Tanay, Mozilla Foundation"Getting started with Web Based Virtual Reality" Pant Tanay, Mozilla Foundation
"Getting started with Web Based Virtual Reality" Pant Tanay, Mozilla Foundation
 
Make believe - Droidcon UK 2015
Make believe - Droidcon UK 2015Make believe - Droidcon UK 2015
Make believe - Droidcon UK 2015
 
The Browser As Console - HTML5 and WebGL for Game Development
The Browser As Console - HTML5 and WebGL for Game DevelopmentThe Browser As Console - HTML5 and WebGL for Game Development
The Browser As Console - HTML5 and WebGL for Game Development
 
Writing Virtual And Augmented Reality Apps With Web Technology
Writing Virtual And Augmented Reality Apps With Web TechnologyWriting Virtual And Augmented Reality Apps With Web Technology
Writing Virtual And Augmented Reality Apps With Web Technology
 
Writing Virtual And Augmented Reality Apps With Web Technology
Writing Virtual And Augmented Reality Apps With Web TechnologyWriting Virtual And Augmented Reality Apps With Web Technology
Writing Virtual And Augmented Reality Apps With Web Technology
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Quick dive into WebVR