SlideShare a Scribd company logo
1 of 16
Download to read offline
WebVR with A-Frame, React
and Redux
Casper	Fabricius	
Co-founder	&	CTO,	Cimmerse
Hi, I’m Casper
I	work	at
What is WebVR WebXR?
WebVR	is	an	experimental	JavaScript	API	that	provides	support	
for	virtual	reality	devices,	such	as	the	HTC	Vive,	Oculus	RiD	or	Google	
Cardboard,	in	a	web	browser.	
	
This	API	is	designed	with	the	following	goals	in	mind:	
•  Detect	available	Virtual	Reality	devices.	
•  Query	the	devices	capabiliKes.	
•  Poll	the	device’s	posi6on	and	orienta6on.	
•  Display	imagery	on	the	device	at	the	appropriate	frame	rate.
The state of WebVR
Browser	 OS	 Hardware	 Fully	released?	
Firefox	(64	bit)	 Windows		 SteamVR	(incl.	HTC	Vive),	Oculus	RiD	 Yes	
Edge	 Windows	 Windows	Mixed	Reality	headsets	 Yes	
Samsung	Internet	 Android	 GearVR,	Cardboard	 Yes	
Oculus	Carmel	 Android	 GearVR	 Yes	
Chrome		 Android	 Daydream,	Cardboard	 Yes,	but	behind	origin	trial	
Firefox	 macOS/Linux	 SteamVR	(incl.	HTC	Vive)	 Yes,	but	must	be	enabled	
Chrome	 Windows	 SteamVR	(incl.	HTC	Vive),	Oculus	RiD	 No,	custom	Chromium	build	
?	 ?
Layers of a WebVR app
WebGL	API	 WebVR	API	 GamePad	API	 WebAudio	API	
WebVR	polyfill	
Three.js	 Babylon.js	 Playcanvas	 OSG.JS	Engine	
Browser	
A-Frame	 React	VR	 X3DOM	AbstracKon
Doesn’t Unity support WebGL and WebVR?
WebGL:	
•  Smaller	games	compile	well	to	
WebGL,	larger	games	may	fail.	
•  WebGL	builds	are	not	officially	
supported	on	any	mobile	device.	
•  Firefox	and	Edge	have	the	best	
support	and	performance.	
WebVR:
So, what can you do with WebVR?
-	quite	a	lot,	actually
My choice of stack
Three.js	
A-Frame	
aframe-react	
React	 Redux	
Apollo	Client	
GraphQL-Ruby	
PostgreSQL
A closer look at A-Frame
Let’s look at some code
aframe-react	
React	 Redux
MenuReducer.js
const initialState = {!
isMainMenuOpen: false,!
openMenuItems: []!
}!
!
export default function menuReducer (state = initialState, action) {!
switch (action.type) {!
case actionTypes.TOGGLE_MAIN_MENU:!
return Object.assign({}, state, {!
isMainMenuOpen: !state.isMainMenuOpen!
})!
case actionTypes.TOGGLE_MENU_ITEM:!
…!
}!
default:!
return state!
}!
}!
!
main.js
const CimmerseViewer = props => {!
const isInVR = props.isInVR!
!
return (!
<ApolloProvider client={props.client} store={props.store}>!
<div>!
<Scene>!
<Model model={props.data.model} />!
{ isInVR && <Menu3D /> }!
</Scene>!
{ !isInVR && <Menu2D /> }!
</div>!
</ApolloProvider>!
)!
}!
Menu2D.js
const Menu2D = props => {!
return (!
<div className={styles.menuContainer}>!
<div!
className={styles.mainMenuButton}!
onClick={props.dispatchToggleMainMenu}!
></div>!
!
{!
props.isMainMenuOpen &&!
renderMenuItems(!
props.openMenuItems,!
props.dispatchToggleMenuItem!
)!
}!
</div>!
)!
}!
const renderMenuItems = (openMenuItems, onToggle) => {!
return (!
<div className={styles.menuItems}>!
{ openMenuItems.forEach(menuItem => {!
return <MenuItem2D!
item={menuItem}!
onToggle={onToggle.bind(undefined, menuItem)}!
/>!
} ) }!
</div>!
)!
}!
!
const Menu2DWithState = connect(!
(state) => ({!
isMainMenuOpen: state.menu.isMainMenuOpen,!
openMenuItems: state.menu.openMenuItems,!
}),!
(dispatch) => ({!
dispatchToggleMainMenu () { dispatch(toggleOnDemandMenu()) },!
dispatchToggleMenuItem (item) { dispatch(toggleOnDemandMenuItem(item)) },!
})!
)(Menu2D)!
!
export default Menu2DWithState!
Menu3D.js
const Toolbar3D = props => {!
return (!
<Entity position={{x: 1, y: 1, z: 0}}>!
<Entity!
text="Menu”!
geometry={{!
primitive: 'plane’,!
width: 0.5,!
height: 0.2!
}}!
/>!
!
{!
props.isMainMenuOpen &&!
renderMenuItems(!
props.openMenuItems,!
props.dispatchToggleMenuItem!
)!
}!
</Entity>!
)!
}!
const renderMenuItems = (openMenuItems, onToggle) => {!
return (!
<Entity>!
{ openMenuItems.forEach(menuItem => {!
return <MenuItem3D!
item={menuItem}!
onToggle={onToggle.bind(undefined, menuItem)}!
/>!
} ) }!
</Entity>!
)!
}!
!
const Menu3DWithState = connect(!
(state) => ({!
isMainMenuOpen: state.menu.isMainMenuOpen,!
openMenuItems: state.menu.openMenuItems,!
}),!
(dispatch) => ({!
dispatchToggleMainMenu () { dispatch(toggleOnDemandMenu()) },!
dispatchToggleMenuItem (item) { dispatch(toggleOnDemandMenuItem(item)) },!
})!
)(Menu3D)!
!
export default Menu3DWithState!
Casper	Fabricius	
	
@fabricius	
casper@cimmerse.com	
	
Learn	more:	
cimmer.se/webvr		
cimmer.se/aframe	
Thank you
www.cimmerse.com	
	
Try	it	right	now	on	your	
phone:	
cimmer.se/shoe	
cimmer.se/handbag	
cimmer.se/sushi

More Related Content

Similar to Casper Fabricius (Cimmerse): WebVR with A-Frame, React and Redux

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
 
WebXR - Introduction and Workshop
WebXR - Introduction and WorkshopWebXR - Introduction and Workshop
WebXR - Introduction and WorkshopTimmy Kokke
 
Casper Fabricius (Cimmerse): The State of WebXR
Casper Fabricius (Cimmerse): The State of WebXRCasper Fabricius (Cimmerse): The State of WebXR
Casper Fabricius (Cimmerse): The State of WebXRAugmentedWorldExpo
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Ryan Cuprak
 
Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016Tony Parisi
 
Virtual Reality on the Web
Virtual Reality on the WebVirtual Reality on the Web
Virtual Reality on the WebTimmy Kokke
 
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Robert 'Bob' Reyes
 
Casper Fabricius (Cimmerse): Building WebXR Applications in Practice
Casper Fabricius (Cimmerse): Building WebXR Applications in PracticeCasper Fabricius (Cimmerse): Building WebXR Applications in Practice
Casper Fabricius (Cimmerse): Building WebXR Applications in PracticeAugmentedWorldExpo
 
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...Sla Va
 
Native to Hybrid and Back Again
Native to Hybrid and Back AgainNative to Hybrid and Back Again
Native to Hybrid and Back AgainNic Raboy
 
"Augmented and Virtual Reality – Ready for Design and Engineering" Cyrille F...
"Augmented and Virtual Reality – Ready for Design and Engineering"  Cyrille F..."Augmented and Virtual Reality – Ready for Design and Engineering"  Cyrille F...
"Augmented and Virtual Reality – Ready for Design and Engineering" Cyrille F...mixARConference
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esdavrous
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptFITC
 
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OSHTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OSAll Things Open
 
VR Development with JavaScript
VR Development with JavaScriptVR Development with JavaScript
VR Development with JavaScriptSchezarnie Racip
 
VR digest. July 2017
VR digest. July 2017VR digest. July 2017
VR digest. July 2017ElifTech
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMartinSotirov
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive WebTony Parisi
 

Similar to Casper Fabricius (Cimmerse): WebVR with A-Frame, React and Redux (20)

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!
 
WebXR - Introduction and Workshop
WebXR - Introduction and WorkshopWebXR - Introduction and Workshop
WebXR - Introduction and Workshop
 
Casper Fabricius (Cimmerse): The State of WebXR
Casper Fabricius (Cimmerse): The State of WebXRCasper Fabricius (Cimmerse): The State of WebXR
Casper Fabricius (Cimmerse): The State of WebXR
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
 
Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016Introduction to WebVR Autodesk Forge 2016
Introduction to WebVR Autodesk Forge 2016
 
Virtual Reality on the Web
Virtual Reality on the WebVirtual Reality on the Web
Virtual Reality on the Web
 
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
 
Casper Fabricius (Cimmerse): Building WebXR Applications in Practice
Casper Fabricius (Cimmerse): Building WebXR Applications in PracticeCasper Fabricius (Cimmerse): Building WebXR Applications in Practice
Casper Fabricius (Cimmerse): Building WebXR Applications in Practice
 
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
 
Native to Hybrid and Back Again
Native to Hybrid and Back AgainNative to Hybrid and Back Again
Native to Hybrid and Back Again
 
The Powerful VR WEB Is Here
The Powerful VR WEB Is HereThe Powerful VR WEB Is Here
The Powerful VR WEB Is Here
 
VR hardware & development
VR hardware & developmentVR hardware & development
VR hardware & development
 
"Augmented and Virtual Reality – Ready for Design and Engineering" Cyrille F...
"Augmented and Virtual Reality – Ready for Design and Engineering"  Cyrille F..."Augmented and Virtual Reality – Ready for Design and Engineering"  Cyrille F...
"Augmented and Virtual Reality – Ready for Design and Engineering" Cyrille F...
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScript
 
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OSHTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OS
 
VR Development with JavaScript
VR Development with JavaScriptVR Development with JavaScript
VR Development with JavaScript
 
VR digest. July 2017
VR digest. July 2017VR digest. July 2017
VR digest. July 2017
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to Native
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive Web
 

More from AugmentedWorldExpo

Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...
Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...
Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...AugmentedWorldExpo
 
Nick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting Tools
Nick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting ToolsNick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting Tools
Nick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting ToolsAugmentedWorldExpo
 
Rokid: Design a seamless solution for AR glasses
Rokid: Design a seamless solution for AR glassesRokid: Design a seamless solution for AR glasses
Rokid: Design a seamless solution for AR glassesAugmentedWorldExpo
 
How AR is Transforming the Online Retail Experience
How AR is Transforming the Online Retail ExperienceHow AR is Transforming the Online Retail Experience
How AR is Transforming the Online Retail ExperienceAugmentedWorldExpo
 
Chloe Doyeon Kim (MAXST): The Current and Future State of MAXST Platform
Chloe Doyeon Kim (MAXST): The Current and Future State of MAXST PlatformChloe Doyeon Kim (MAXST): The Current and Future State of MAXST Platform
Chloe Doyeon Kim (MAXST): The Current and Future State of MAXST PlatformAugmentedWorldExpo
 
AWE USA 2019: Owning Augmented Space
AWE USA 2019: Owning Augmented SpaceAWE USA 2019: Owning Augmented Space
AWE USA 2019: Owning Augmented SpaceAugmentedWorldExpo
 
Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?
Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?
Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?AugmentedWorldExpo
 
Chris Pickett (DigiLens): XR is Hard: Here’s Why
Chris Pickett (DigiLens): XR is Hard: Here’s WhyChris Pickett (DigiLens): XR is Hard: Here’s Why
Chris Pickett (DigiLens): XR is Hard: Here’s WhyAugmentedWorldExpo
 
Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...
Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...
Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...AugmentedWorldExpo
 
Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...
Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...
Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...AugmentedWorldExpo
 
Augmented reality meets Television -Ellen DeGeneres' Game of Games AR App
Augmented reality meets Television -Ellen DeGeneres' Game of Games AR AppAugmented reality meets Television -Ellen DeGeneres' Game of Games AR App
Augmented reality meets Television -Ellen DeGeneres' Game of Games AR AppAugmentedWorldExpo
 
Jennifer Cook (Dreamscape Immersive): Dreamscape Immersive Presentation
Jennifer Cook (Dreamscape Immersive): Dreamscape Immersive PresentationJennifer Cook (Dreamscape Immersive): Dreamscape Immersive Presentation
Jennifer Cook (Dreamscape Immersive): Dreamscape Immersive PresentationAugmentedWorldExpo
 
AWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operatorsAWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operatorsAugmentedWorldExpo
 
Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...
Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...
Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...AugmentedWorldExpo
 
Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...
Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...
Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...AugmentedWorldExpo
 
Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...
Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...
Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...AugmentedWorldExpo
 
Valentin Heun (PTC): One Reality - A 3rd generation AR User Interface
Valentin Heun (PTC): One Reality - A 3rd generation AR User InterfaceValentin Heun (PTC): One Reality - A 3rd generation AR User Interface
Valentin Heun (PTC): One Reality - A 3rd generation AR User InterfaceAugmentedWorldExpo
 
Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...
Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...
Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...AugmentedWorldExpo
 
Sarah Hill (Healium by StoryUP Studios): Healing Stories Powered by Biometrics
Sarah Hill (Healium by StoryUP Studios): Healing Stories Powered by BiometricsSarah Hill (Healium by StoryUP Studios): Healing Stories Powered by Biometrics
Sarah Hill (Healium by StoryUP Studios): Healing Stories Powered by BiometricsAugmentedWorldExpo
 
Iva Leon (ARVR Women and Allies): Building community with social VR
Iva Leon (ARVR Women and Allies): Building community with social VRIva Leon (ARVR Women and Allies): Building community with social VR
Iva Leon (ARVR Women and Allies): Building community with social VRAugmentedWorldExpo
 

More from AugmentedWorldExpo (20)

Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...
Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...
Bill Meyer (Virtual Science Center): Turning Kids on to STEM by Letting Them ...
 
Nick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting Tools
Nick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting ToolsNick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting Tools
Nick Klingensmith (Microsoft): Increasing Immersion with the MR Lighting Tools
 
Rokid: Design a seamless solution for AR glasses
Rokid: Design a seamless solution for AR glassesRokid: Design a seamless solution for AR glasses
Rokid: Design a seamless solution for AR glasses
 
How AR is Transforming the Online Retail Experience
How AR is Transforming the Online Retail ExperienceHow AR is Transforming the Online Retail Experience
How AR is Transforming the Online Retail Experience
 
Chloe Doyeon Kim (MAXST): The Current and Future State of MAXST Platform
Chloe Doyeon Kim (MAXST): The Current and Future State of MAXST PlatformChloe Doyeon Kim (MAXST): The Current and Future State of MAXST Platform
Chloe Doyeon Kim (MAXST): The Current and Future State of MAXST Platform
 
AWE USA 2019: Owning Augmented Space
AWE USA 2019: Owning Augmented SpaceAWE USA 2019: Owning Augmented Space
AWE USA 2019: Owning Augmented Space
 
Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?
Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?
Victor Sun (Shadow Creator): How to turn Mixed Reality “headset” into “glasses”?
 
Chris Pickett (DigiLens): XR is Hard: Here’s Why
Chris Pickett (DigiLens): XR is Hard: Here’s WhyChris Pickett (DigiLens): XR is Hard: Here’s Why
Chris Pickett (DigiLens): XR is Hard: Here’s Why
 
Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...
Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...
Antti Sunnari (Dispelix Ltd): Full-color, single-waveguide near-eye displays ...
 
Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...
Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...
Jian Liang (HiScene): AR for Industry in China: From Concepts to Real Applica...
 
Augmented reality meets Television -Ellen DeGeneres' Game of Games AR App
Augmented reality meets Television -Ellen DeGeneres' Game of Games AR AppAugmented reality meets Television -Ellen DeGeneres' Game of Games AR App
Augmented reality meets Television -Ellen DeGeneres' Game of Games AR App
 
Jennifer Cook (Dreamscape Immersive): Dreamscape Immersive Presentation
Jennifer Cook (Dreamscape Immersive): Dreamscape Immersive PresentationJennifer Cook (Dreamscape Immersive): Dreamscape Immersive Presentation
Jennifer Cook (Dreamscape Immersive): Dreamscape Immersive Presentation
 
AWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operatorsAWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operators
 
Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...
Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...
Phil LaFond (Bosch Automotive Service Solutions Inc.): Bosch Technical Traini...
 
Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...
Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...
Scott Montgomerie (Scope AR): AR’s Influence on the Workforce of Tomorrow: Jo...
 
Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...
Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...
Hugo Swart (Qualcomm, Inc.): How 5G, Distributed Processing and Technology Ad...
 
Valentin Heun (PTC): One Reality - A 3rd generation AR User Interface
Valentin Heun (PTC): One Reality - A 3rd generation AR User InterfaceValentin Heun (PTC): One Reality - A 3rd generation AR User Interface
Valentin Heun (PTC): One Reality - A 3rd generation AR User Interface
 
Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...
Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...
Anton Ebert (Siemens Healthcare): Challenges and approaches on integrating a ...
 
Sarah Hill (Healium by StoryUP Studios): Healing Stories Powered by Biometrics
Sarah Hill (Healium by StoryUP Studios): Healing Stories Powered by BiometricsSarah Hill (Healium by StoryUP Studios): Healing Stories Powered by Biometrics
Sarah Hill (Healium by StoryUP Studios): Healing Stories Powered by Biometrics
 
Iva Leon (ARVR Women and Allies): Building community with social VR
Iva Leon (ARVR Women and Allies): Building community with social VRIva Leon (ARVR Women and Allies): Building community with social VR
Iva Leon (ARVR Women and Allies): Building community with social VR
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 

Casper Fabricius (Cimmerse): WebVR with A-Frame, React and Redux

  • 1. WebVR with A-Frame, React and Redux Casper Fabricius Co-founder & CTO, Cimmerse
  • 3. What is WebVR WebXR? WebVR is an experimental JavaScript API that provides support for virtual reality devices, such as the HTC Vive, Oculus RiD or Google Cardboard, in a web browser. This API is designed with the following goals in mind: •  Detect available Virtual Reality devices. •  Query the devices capabiliKes. •  Poll the device’s posi6on and orienta6on. •  Display imagery on the device at the appropriate frame rate.
  • 4. The state of WebVR Browser OS Hardware Fully released? Firefox (64 bit) Windows SteamVR (incl. HTC Vive), Oculus RiD Yes Edge Windows Windows Mixed Reality headsets Yes Samsung Internet Android GearVR, Cardboard Yes Oculus Carmel Android GearVR Yes Chrome Android Daydream, Cardboard Yes, but behind origin trial Firefox macOS/Linux SteamVR (incl. HTC Vive) Yes, but must be enabled Chrome Windows SteamVR (incl. HTC Vive), Oculus RiD No, custom Chromium build ? ?
  • 5. Layers of a WebVR app WebGL API WebVR API GamePad API WebAudio API WebVR polyfill Three.js Babylon.js Playcanvas OSG.JS Engine Browser A-Frame React VR X3DOM AbstracKon
  • 6. Doesn’t Unity support WebGL and WebVR? WebGL: •  Smaller games compile well to WebGL, larger games may fail. •  WebGL builds are not officially supported on any mobile device. •  Firefox and Edge have the best support and performance. WebVR:
  • 7. So, what can you do with WebVR? - quite a lot, actually
  • 8.
  • 9. My choice of stack Three.js A-Frame aframe-react React Redux Apollo Client GraphQL-Ruby PostgreSQL
  • 10. A closer look at A-Frame
  • 11. Let’s look at some code aframe-react React Redux
  • 12. MenuReducer.js const initialState = {! isMainMenuOpen: false,! openMenuItems: []! }! ! export default function menuReducer (state = initialState, action) {! switch (action.type) {! case actionTypes.TOGGLE_MAIN_MENU:! return Object.assign({}, state, {! isMainMenuOpen: !state.isMainMenuOpen! })! case actionTypes.TOGGLE_MENU_ITEM:! …! }! default:! return state! }! }! !
  • 13. main.js const CimmerseViewer = props => {! const isInVR = props.isInVR! ! return (! <ApolloProvider client={props.client} store={props.store}>! <div>! <Scene>! <Model model={props.data.model} />! { isInVR && <Menu3D /> }! </Scene>! { !isInVR && <Menu2D /> }! </div>! </ApolloProvider>! )! }!
  • 14. Menu2D.js const Menu2D = props => {! return (! <div className={styles.menuContainer}>! <div! className={styles.mainMenuButton}! onClick={props.dispatchToggleMainMenu}! ></div>! ! {! props.isMainMenuOpen &&! renderMenuItems(! props.openMenuItems,! props.dispatchToggleMenuItem! )! }! </div>! )! }! const renderMenuItems = (openMenuItems, onToggle) => {! return (! <div className={styles.menuItems}>! { openMenuItems.forEach(menuItem => {! return <MenuItem2D! item={menuItem}! onToggle={onToggle.bind(undefined, menuItem)}! />! } ) }! </div>! )! }! ! const Menu2DWithState = connect(! (state) => ({! isMainMenuOpen: state.menu.isMainMenuOpen,! openMenuItems: state.menu.openMenuItems,! }),! (dispatch) => ({! dispatchToggleMainMenu () { dispatch(toggleOnDemandMenu()) },! dispatchToggleMenuItem (item) { dispatch(toggleOnDemandMenuItem(item)) },! })! )(Menu2D)! ! export default Menu2DWithState!
  • 15. Menu3D.js const Toolbar3D = props => {! return (! <Entity position={{x: 1, y: 1, z: 0}}>! <Entity! text="Menu”! geometry={{! primitive: 'plane’,! width: 0.5,! height: 0.2! }}! />! ! {! props.isMainMenuOpen &&! renderMenuItems(! props.openMenuItems,! props.dispatchToggleMenuItem! )! }! </Entity>! )! }! const renderMenuItems = (openMenuItems, onToggle) => {! return (! <Entity>! { openMenuItems.forEach(menuItem => {! return <MenuItem3D! item={menuItem}! onToggle={onToggle.bind(undefined, menuItem)}! />! } ) }! </Entity>! )! }! ! const Menu3DWithState = connect(! (state) => ({! isMainMenuOpen: state.menu.isMainMenuOpen,! openMenuItems: state.menu.openMenuItems,! }),! (dispatch) => ({! dispatchToggleMainMenu () { dispatch(toggleOnDemandMenu()) },! dispatchToggleMenuItem (item) { dispatch(toggleOnDemandMenuItem(item)) },! })! )(Menu3D)! ! export default Menu3DWithState!