SlideShare a Scribd company logo
A-Frame
aframe.io


Daosheng Mu
@mozilla
2016/01/08
https://goo.gl/de2YG1
About Me
• Six years experience in the game industry
• Contributor to three.js
• Working on Firefox OS TV product
• Responsible for Gaming, Graphics
@daoshengmu
Outline
• WebVR
• A-Frame
• Customize HTMLElement
• Entity-Component system
• Build own component
Mozilla VR team -
“Our goal is to help
bring high
performance virtual
reality to the open
web.”
Recap: WebVR
Recap: WebVR
Recap: WebVR
var leftEyeParams = vrHMD.getEyeParameters(‘left’);

var rightEyeParams = vrHMD.getEyeParameters(‘right’);
// In meters

var leftEyeTranslation = leftEyeParams.eyeTranslation; 

var rightEyeTranslation = rightEyeParams.eyeTranslation; 

var leftEyeFOV = leftEyeParams.recommendedFieldOfView; 

var rightEyeFOV = rightEyeParams.recommendedFieldOfView;
Recap: WebVR
function onRequestAnimationFrame() {

if ( vrPosSensor ) {

var state = vrPosSensor.getState();

if ( state.hasOrientation ) {

camera.quaternion.set(

state.orientation.x, state.orientation.y,

state.orientation.z, state.orientation.w);

}

}

render( camera ); 

}
Recap: WebVR
function render( camera ) {

// Left eye

setViewport( leftEyeParams );

setProjMatrix( leftEyeFOV );

setViewMatrix( camera.matrixWorld, leftEyeTranslation );

drawScene();

// Right eye

setViewport( rightEyeParams );

setProjMatrix( rightEyeFOV );

setViewMatrix( camera.matrixWorld, rightEyeTranslation );

drawScene();

}
Ready to WebVR 1.0?
• Refresh rate
• Fullscreen
• VR Gamepad
• Merge HMD/Pose
SUCCESS STORIES
A-Frame
Building blocks for the
virtual reality web
A-Frame
Demo
• VR Shopping
• 360 Video
• Panorama
A-Frame
• Building blocks for the virtual reality web
• Use markup to create VR experiences that work across desktop,
iPhones, and the Oculus Rift. Android support coming soon.
• Virtual Reality: Drop in the library and have a WebVR scene
within a few lines of markup.
• Based on the DOM: Manipulate with JavaScript, use with your
favorite libraries and frameworks.
• Entity-Component System: Use the entity-component system
for better composability and flexibility.
<a-entity geometry="primitive: cube; material="color:
pink”></a-entity>
webcomponents.js ?
webcomponents.js ?
“webcomponents.js is a set of polyfills built on top of the Web
Components specifications.”
•Custom Elements: Define new elements in HTML.
var Mytag = document.registerElement('my-tag');

document.body.appendChild(new Mytag());



var mytag = document.getElementsByTagName(‘my-tag’)[0];

mytag.textContent = ‘I am a my-tag element.’;
dom.webcomponents.enabled;true
X Cross-all-browsers
webcomponents.js ?
A-Framedocument-register-element.js



A stand-alone working lightweight version of the W3C
Custom Elements specification
var Mytag = document.registerElement(

'my-tag',

{

prototype: Object.create(

HTMLElement.prototype, {

})

}

);
A-Frame Core
A DOM-based Entity-Component System to
declaratively create 3D and VR worlds in the browser.
Entity-Component System is an architectural pattern
commonly used in game engines such as Unity,
PlayCanvas, an Unreal Engine 4+.
Elements

• Templates
• Events
Core

• Components
• Entity
• Scene
• Utils
aframe
aframe-core
<body>

<a-scene stats="true">

<a-entity geometry="primitive: box;"
material="color: #d00">

</a-entity>

</a-scene>

</body>
Scene
Entity
Component
Entity system in A-Frame
Entities are HTML elements (i.e., <a-entity>).
Components are HTML attributes that are set on
the entity.
<a-entity geometry="primitive: cube; depth: 1;
height: 1; width: 1"

material="color: pink”></a-entity>
<a-entity geometry="primitive: cube; depth: 1;
height: 1; width: 1"

material="color: pink”>

</a-entity>
<a-entity geometry="primitive: cube; depth: 1;
height: 1; width: 1"

material="color: pink” light="intensity: 2">

</a-entity>
<a-entity geometry="primitive: cube; depth: 1; 

height: 1; width: 1"

material="color: pink” 

light="intensity: 2” position="-1 5 0” 

sound="src: dangerzone.mp3; volume: 2">

</a-entity>
Entity
<a-entity>
• Entities are general purpose objects (e.g., to
create a player, monster, sky, or cube).
• They inherently have a position, rotation, and
scale in the scene.
Properties
- components
- sceneEl


Methods
- emit
- get/setAttribute
- getComputedAttribute
- removeAttribute


Events
- componentChanged
- loaded
Component
• Components are reusable and modular chunks
of data that modify an aspect of an entity,
changing its appearance, behavior, or
functionality.
Defining Component Data
<a-entity geometry="primitive: box; width: 5"></a-entity>
var entity = document.querySelector('a-entity');

entity.setAttribute('material', 'color: red');

entity.setAttribute('geometry', {primitive: 'box'});

entity.setAttribute('geometry', 'width', 5);
OR
Building a Component
require('aframe').registerComponent('vibrate', {
});
Building a Component
require('aframe').registerComponent('vibrate', {
});
init: function () {
this.animationEl
= null;
},
schema: {

dur: {

default: 20

},

offset: {

default: 0.01

}

},
update: function () {

var anim = document.createElement('a-
animation');

var position = this.el.getAttribute('position');

anim.setAttribute('attribute', 'position');

anim.setAttribute('direction', 'alternate');

anim.setAttribute('dur', this.data.dur);

anim.setAttribute('repeat', 'indefinite');

anim.setAttribute('to', position.x +
this.data.offset + ' ' + position.y +
this.data.offset + position.z +
this.data.offset);



…

remove: function () { 

if (this.animationEl) {

this.el.removeChild(

this.animationEl); 

}

}
Building a Component
• Implement Particle component
• three.js: points / sprites (http://threejs.org/
examples/#webgl_points_sprites)
• Add components/particle to index.js
• npm run dev
Scene
• Set up what to render, where to render, and is where all of the entities live.
• Initialization
• Creating a canvas
• Instantiating a renderer
• Attaching event and full screen listeners
• Setting up default lighting and camera
• Injecting <meta> tags and button to Enter VR
• Registering keyboard shortcuts
• Render Loop
• requestAnimationFrame
<a-scene>
AScene
three.js
Animation
<a-animation>
<a-entity geometry="primitive: box;" material="color: pink" position="0 0 0"
rotation="0 0 0">

<a-animation attribute="rotation" to="0 360 0" dur="3000" fill="forwards" 

repeat="indefinite">

</a-animation>

</a-entity>
Elements

• Templates
• Events
Core

• Components
• Entity
• Scene
• Utils
aframe
aframe-core
Primitives
Primitives are concise, semantic building blocks
that wrap A-Frame’s underlying entity-component
system.
<a-entity geometry="primitive: box; width: 3" material="color: red">

</a-entity>
<a-cube width="3" color="red"></a-cube>
Templates
• Templates package multiple entities or primitives
into a custom element for easy reuse.
<template is="a-template" element="a-lot-of-cubes">

<a-cube color="red" depth="1" height="1" width="1" position="-1 0 0">

</a-cube>

<a-cube color="blue" depth="1" height="1" width="1" position="0 1 0">

</a-cube>

<a-cube color="green" depth="1" height="1" width="1" position="1 0 0">

</a-cube>

</template>
<a-lot-of-cubes></a-lot-of-cubes>

<a-lot-of-cubes position="10 0 0"></a-lot-of-cubes>
Templates
<template is="a-template" element="a-lot-of-cubes" size="1">

<a-cube color="red" depth="${size}" height="${size}" width="${size}" 

position="-${size} 0 0"></a-cube>

<a-cube color="green" depth="${size}" height="${size}" width="${size}" 

position="-${size} 0 0"></a-cube>

<a-cube color="blue" depth="${size}" height="${size}" width="${size}" 

position="-${size} 0 0"></a-cube>

</template>
<a-lot-of-cubes size="5"></a-lot-of-cubes>

<a-lot-of-cubes position="10 0 0"></a-lot-of-cubes>
Mixin
<a-mixin>
• Mixins provide a way to compose and reuse
commonly-used sets of component properties.
<a-assets>

<a-mixin id="red" material="color: red"></a-mixin>

<a-mixin id="blue" material="color: blue"></a-mixin>

<a-mixin id="cube" geometry="primitive: box"></a-mixin>

</a-assets>

<a-scene>

<a-entity mixin="red cube"></a-entity>

<a-entity mixin="blue cube"></a-entity>

</a-scene>
Conclusion
• Next version of WebVR API is working on
• A-Frame provides developers a rapid way to
make WebVR content
• A-Frame makes “Write once, Run everywhere” to
be real
Platform Support
Oculus

Firefox
Android

Firefox
iOS

Safari
FxOS
HMD WebVR WebVR webvr-polyfill WebVR
Position WebVR X X X
Orientation WebVR WebVR
webvr-polyfill:
devicemotion
WebVR: but
quiet slow
Fullscreen WebVR
X distortion
correction
filter
X distortion
correction
filter
X distortion
correction
filter
Thanks for your attention

More Related Content

What's hot

메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템
메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템 메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템
메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템
ByungTak Kang
 
Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]
BrowserStack
 
Introduction to three.js
Introduction to three.jsIntroduction to three.js
Introduction to three.js
yuxiang21
 
Webdriver io presentation
Webdriver io presentationWebdriver io presentation
Webdriver io presentation
João Nabais
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
DivyanshGupta922023
 
Workshop React.js
Workshop React.jsWorkshop React.js
Workshop React.js
Commit University
 
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platformGrokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking VN
 
Wix's ML Platform
Wix's ML PlatformWix's ML Platform
Wix's ML Platform
Ran Romano
 
Initiation à l'intégration avec biztalk server
Initiation à l'intégration avec biztalk serverInitiation à l'intégration avec biztalk server
Initiation à l'intégration avec biztalk server
Salah Eddine BENTALBA (+15K Connections)
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
Sauce Labs
 
Como criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com CypressComo criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com Cypress
Walmyr Lima e Silva Filho
 
Automation Framework Presentation
Automation Framework PresentationAutomation Framework Presentation
Automation Framework Presentation
Ben Ngo
 
React Native na globo.com
React Native na globo.comReact Native na globo.com
React Native na globo.com
Guilherme Heynemann Bruzzi
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
적당한 스터디 발표자료 만들기
적당한 스터디 발표자료 만들기적당한 스터디 발표자료 만들기
적당한 스터디 발표자료 만들기
종빈 오
 
React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.
ManojSatishKumar
 
WebGL and three.js
WebGL and three.jsWebGL and three.js
WebGL and three.js
Anton Narusberg
 
Integration testing for microservices with Spring Boot
Integration testing for microservices with Spring BootIntegration testing for microservices with Spring Boot
Integration testing for microservices with Spring Boot
Oleksandr Romanov
 
Getting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | SalesforceGetting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | Salesforce
Rahul Malhotra
 
Intro to React
Intro to ReactIntro to React
Intro to React
Justin Reock
 

What's hot (20)

메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템
메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템 메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템
메이플스토리 사례를 통해 살펴보는 서버사이드 봇/핵 탐지 시스템
 
Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]
 
Introduction to three.js
Introduction to three.jsIntroduction to three.js
Introduction to three.js
 
Webdriver io presentation
Webdriver io presentationWebdriver io presentation
Webdriver io presentation
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
Workshop React.js
Workshop React.jsWorkshop React.js
Workshop React.js
 
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platformGrokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
 
Wix's ML Platform
Wix's ML PlatformWix's ML Platform
Wix's ML Platform
 
Initiation à l'intégration avec biztalk server
Initiation à l'intégration avec biztalk serverInitiation à l'intégration avec biztalk server
Initiation à l'intégration avec biztalk server
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Como criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com CypressComo criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com Cypress
 
Automation Framework Presentation
Automation Framework PresentationAutomation Framework Presentation
Automation Framework Presentation
 
React Native na globo.com
React Native na globo.comReact Native na globo.com
React Native na globo.com
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
적당한 스터디 발표자료 만들기
적당한 스터디 발표자료 만들기적당한 스터디 발표자료 만들기
적당한 스터디 발표자료 만들기
 
React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.React hooks Episode #1: An introduction.
React hooks Episode #1: An introduction.
 
WebGL and three.js
WebGL and three.jsWebGL and three.js
WebGL and three.js
 
Integration testing for microservices with Spring Boot
Integration testing for microservices with Spring BootIntegration testing for microservices with Spring Boot
Integration testing for microservices with Spring Boot
 
Getting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | SalesforceGetting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | Salesforce
 
Intro to React
Intro to ReactIntro to React
Intro to React
 

Similar to Introduction to A-Frame

Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017
Roland Olivier Dubois
 
Developing Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptxDeveloping Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptx
Dmitry Vinnik
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
Anup Hariharan Nair
 
A frame beginner lesson
A frame beginner lessonA frame beginner lesson
A frame beginner lesson
Daosheng Mu
 
Lightning chess
Lightning chessLightning chess
Lightning chess
Lieven Juwet
 
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
Sencha
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web Components
Red Pill Now
 
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
FITC
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
Agile Testing Alliance
 
Web Performance Part 4 "Client-side performance"
Web Performance Part 4  "Client-side performance"Web Performance Part 4  "Client-side performance"
Web Performance Part 4 "Client-side performance"
Binary Studio
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
Troy Miles
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
Sergey Shekyan
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOS
fpatton
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
alexsaves
 
Node azure
Node azureNode azure
Node azure
Emanuele DelBono
 
Knowledge of web ui for automation testing
Knowledge  of web ui for automation testingKnowledge  of web ui for automation testing
Knowledge of web ui for automation testing
Artem Korchevyi
 
Blazor
BlazorBlazor
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 

Similar to Introduction to A-Frame (20)

Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017Ferguson VR Hackathon - May 6, 2017
Ferguson VR Hackathon - May 6, 2017
 
Developing Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptxDeveloping Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptx
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
A frame beginner lesson
A frame beginner lessonA frame beginner lesson
A frame beginner lesson
 
Lightning chess
Lightning chessLightning chess
Lightning chess
 
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web Components
 
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
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Web Performance Part 4 "Client-side performance"
Web Performance Part 4  "Client-side performance"Web Performance Part 4  "Client-side performance"
Web Performance Part 4 "Client-side performance"
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOS
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Node azure
Node azureNode azure
Node azure
 
Knowledge of web ui for automation testing
Knowledge  of web ui for automation testingKnowledge  of web ui for automation testing
Knowledge of web ui for automation testing
 
Blazor
BlazorBlazor
Blazor
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 

More from Daosheng Mu

Webrender 1.0
Webrender 1.0Webrender 1.0
Webrender 1.0
Daosheng Mu
 
Maze VR
Maze VRMaze VR
Maze VR
Daosheng Mu
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVR
Daosheng Mu
 
Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...
Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...
Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...
Daosheng Mu
 
Introduce to 3d rendering engine
Introduce to 3d rendering engineIntroduce to 3d rendering engine
Introduce to 3d rendering engine
Daosheng Mu
 
Direct3D to WPF
Direct3D to WPFDirect3D to WPF
Direct3D to WPF
Daosheng Mu
 
Order independent transparency
Order independent transparencyOrder independent transparency
Order independent transparency
Daosheng Mu
 
Design your 3d game engine
Design your 3d game engineDesign your 3d game engine
Design your 3d game engine
Daosheng Mu
 

More from Daosheng Mu (8)

Webrender 1.0
Webrender 1.0Webrender 1.0
Webrender 1.0
 
Maze VR
Maze VRMaze VR
Maze VR
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVR
 
Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...
Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...
Using The New Flash Stage3D Web Technology To Build Your Own Next 3D Browser ...
 
Introduce to 3d rendering engine
Introduce to 3d rendering engineIntroduce to 3d rendering engine
Introduce to 3d rendering engine
 
Direct3D to WPF
Direct3D to WPFDirect3D to WPF
Direct3D to WPF
 
Order independent transparency
Order independent transparencyOrder independent transparency
Order independent transparency
 
Design your 3d game engine
Design your 3d game engineDesign your 3d game engine
Design your 3d game engine
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 

Introduction to A-Frame

  • 2. About Me • Six years experience in the game industry • Contributor to three.js • Working on Firefox OS TV product • Responsible for Gaming, Graphics @daoshengmu
  • 3. Outline • WebVR • A-Frame • Customize HTMLElement • Entity-Component system • Build own component
  • 4. Mozilla VR team - “Our goal is to help bring high performance virtual reality to the open web.”
  • 7. Recap: WebVR var leftEyeParams = vrHMD.getEyeParameters(‘left’);
 var rightEyeParams = vrHMD.getEyeParameters(‘right’); // In meters
 var leftEyeTranslation = leftEyeParams.eyeTranslation; 
 var rightEyeTranslation = rightEyeParams.eyeTranslation; 
 var leftEyeFOV = leftEyeParams.recommendedFieldOfView; 
 var rightEyeFOV = rightEyeParams.recommendedFieldOfView;
  • 8. Recap: WebVR function onRequestAnimationFrame() {
 if ( vrPosSensor ) {
 var state = vrPosSensor.getState();
 if ( state.hasOrientation ) {
 camera.quaternion.set(
 state.orientation.x, state.orientation.y,
 state.orientation.z, state.orientation.w);
 }
 }
 render( camera ); 
 }
  • 9. Recap: WebVR function render( camera ) {
 // Left eye
 setViewport( leftEyeParams );
 setProjMatrix( leftEyeFOV );
 setViewMatrix( camera.matrixWorld, leftEyeTranslation );
 drawScene();
 // Right eye
 setViewport( rightEyeParams );
 setProjMatrix( rightEyeFOV );
 setViewMatrix( camera.matrixWorld, rightEyeTranslation );
 drawScene();
 }
  • 10. Ready to WebVR 1.0? • Refresh rate • Fullscreen • VR Gamepad • Merge HMD/Pose
  • 12. A-Frame Building blocks for the virtual reality web
  • 13. A-Frame Demo • VR Shopping • 360 Video • Panorama
  • 14. A-Frame • Building blocks for the virtual reality web • Use markup to create VR experiences that work across desktop, iPhones, and the Oculus Rift. Android support coming soon. • Virtual Reality: Drop in the library and have a WebVR scene within a few lines of markup. • Based on the DOM: Manipulate with JavaScript, use with your favorite libraries and frameworks. • Entity-Component System: Use the entity-component system for better composability and flexibility.
  • 15. <a-entity geometry="primitive: cube; material="color: pink”></a-entity> webcomponents.js ?
  • 16. webcomponents.js ? “webcomponents.js is a set of polyfills built on top of the Web Components specifications.” •Custom Elements: Define new elements in HTML. var Mytag = document.registerElement('my-tag');
 document.body.appendChild(new Mytag());
 
 var mytag = document.getElementsByTagName(‘my-tag’)[0];
 mytag.textContent = ‘I am a my-tag element.’; dom.webcomponents.enabled;true X Cross-all-browsers
  • 17. webcomponents.js ? A-Framedocument-register-element.js
 
 A stand-alone working lightweight version of the W3C Custom Elements specification var Mytag = document.registerElement(
 'my-tag',
 {
 prototype: Object.create(
 HTMLElement.prototype, {
 })
 }
 );
  • 18. A-Frame Core A DOM-based Entity-Component System to declaratively create 3D and VR worlds in the browser. Entity-Component System is an architectural pattern commonly used in game engines such as Unity, PlayCanvas, an Unreal Engine 4+.
  • 19. Elements
 • Templates • Events Core
 • Components • Entity • Scene • Utils aframe aframe-core
  • 20. <body>
 <a-scene stats="true">
 <a-entity geometry="primitive: box;" material="color: #d00">
 </a-entity>
 </a-scene>
 </body> Scene Entity Component
  • 21. Entity system in A-Frame Entities are HTML elements (i.e., <a-entity>). Components are HTML attributes that are set on the entity. <a-entity geometry="primitive: cube; depth: 1; height: 1; width: 1"
 material="color: pink”></a-entity>
  • 22. <a-entity geometry="primitive: cube; depth: 1; height: 1; width: 1"
 material="color: pink”>
 </a-entity>
  • 23. <a-entity geometry="primitive: cube; depth: 1; height: 1; width: 1"
 material="color: pink” light="intensity: 2">
 </a-entity>
  • 24. <a-entity geometry="primitive: cube; depth: 1; 
 height: 1; width: 1"
 material="color: pink” 
 light="intensity: 2” position="-1 5 0” 
 sound="src: dangerzone.mp3; volume: 2">
 </a-entity>
  • 25.
  • 26. Entity <a-entity> • Entities are general purpose objects (e.g., to create a player, monster, sky, or cube). • They inherently have a position, rotation, and scale in the scene. Properties - components - sceneEl 
 Methods - emit - get/setAttribute - getComputedAttribute - removeAttribute 
 Events - componentChanged - loaded
  • 27. Component • Components are reusable and modular chunks of data that modify an aspect of an entity, changing its appearance, behavior, or functionality.
  • 28. Defining Component Data <a-entity geometry="primitive: box; width: 5"></a-entity> var entity = document.querySelector('a-entity');
 entity.setAttribute('material', 'color: red');
 entity.setAttribute('geometry', {primitive: 'box'});
 entity.setAttribute('geometry', 'width', 5); OR
  • 30. Building a Component require('aframe').registerComponent('vibrate', { }); init: function () { this.animationEl = null; }, schema: {
 dur: {
 default: 20
 },
 offset: {
 default: 0.01
 }
 }, update: function () {
 var anim = document.createElement('a- animation');
 var position = this.el.getAttribute('position');
 anim.setAttribute('attribute', 'position');
 anim.setAttribute('direction', 'alternate');
 anim.setAttribute('dur', this.data.dur);
 anim.setAttribute('repeat', 'indefinite');
 anim.setAttribute('to', position.x + this.data.offset + ' ' + position.y + this.data.offset + position.z + this.data.offset);
 
 …
 remove: function () { 
 if (this.animationEl) {
 this.el.removeChild(
 this.animationEl); 
 }
 }
  • 31. Building a Component • Implement Particle component • three.js: points / sprites (http://threejs.org/ examples/#webgl_points_sprites) • Add components/particle to index.js • npm run dev
  • 32. Scene • Set up what to render, where to render, and is where all of the entities live. • Initialization • Creating a canvas • Instantiating a renderer • Attaching event and full screen listeners • Setting up default lighting and camera • Injecting <meta> tags and button to Enter VR • Registering keyboard shortcuts • Render Loop • requestAnimationFrame <a-scene> AScene three.js
  • 33. Animation <a-animation> <a-entity geometry="primitive: box;" material="color: pink" position="0 0 0" rotation="0 0 0">
 <a-animation attribute="rotation" to="0 360 0" dur="3000" fill="forwards" 
 repeat="indefinite">
 </a-animation>
 </a-entity>
  • 34. Elements
 • Templates • Events Core
 • Components • Entity • Scene • Utils aframe aframe-core
  • 35. Primitives Primitives are concise, semantic building blocks that wrap A-Frame’s underlying entity-component system. <a-entity geometry="primitive: box; width: 3" material="color: red">
 </a-entity> <a-cube width="3" color="red"></a-cube>
  • 36. Templates • Templates package multiple entities or primitives into a custom element for easy reuse. <template is="a-template" element="a-lot-of-cubes">
 <a-cube color="red" depth="1" height="1" width="1" position="-1 0 0">
 </a-cube>
 <a-cube color="blue" depth="1" height="1" width="1" position="0 1 0">
 </a-cube>
 <a-cube color="green" depth="1" height="1" width="1" position="1 0 0">
 </a-cube>
 </template> <a-lot-of-cubes></a-lot-of-cubes>
 <a-lot-of-cubes position="10 0 0"></a-lot-of-cubes>
  • 37. Templates <template is="a-template" element="a-lot-of-cubes" size="1">
 <a-cube color="red" depth="${size}" height="${size}" width="${size}" 
 position="-${size} 0 0"></a-cube>
 <a-cube color="green" depth="${size}" height="${size}" width="${size}" 
 position="-${size} 0 0"></a-cube>
 <a-cube color="blue" depth="${size}" height="${size}" width="${size}" 
 position="-${size} 0 0"></a-cube>
 </template> <a-lot-of-cubes size="5"></a-lot-of-cubes>
 <a-lot-of-cubes position="10 0 0"></a-lot-of-cubes>
  • 38. Mixin <a-mixin> • Mixins provide a way to compose and reuse commonly-used sets of component properties. <a-assets>
 <a-mixin id="red" material="color: red"></a-mixin>
 <a-mixin id="blue" material="color: blue"></a-mixin>
 <a-mixin id="cube" geometry="primitive: box"></a-mixin>
 </a-assets>
 <a-scene>
 <a-entity mixin="red cube"></a-entity>
 <a-entity mixin="blue cube"></a-entity>
 </a-scene>
  • 39. Conclusion • Next version of WebVR API is working on • A-Frame provides developers a rapid way to make WebVR content • A-Frame makes “Write once, Run everywhere” to be real
  • 40. Platform Support Oculus
 Firefox Android
 Firefox iOS
 Safari FxOS HMD WebVR WebVR webvr-polyfill WebVR Position WebVR X X X Orientation WebVR WebVR webvr-polyfill: devicemotion WebVR: but quiet slow Fullscreen WebVR X distortion correction filter X distortion correction filter X distortion correction filter
  • 41. Thanks for your attention