A-Frame VR
from Mozilla
@donrmccurdy
Building blocks for the virtual reality web
What’s WebVR?
“WebVR is an experimental Javascript API that provides � access to Virtual Reality devices, such as the Oculus � Rift or Google Cardboard, in your browser.”
https://w3c.github.io/webvr/
WebGL + WebVR + THREE.js + A-Frame VR
A-Frame Markup.
<a-scene>
<!-- Robot -->
<a-entity collada-model="url(robot.dae);"
path="radius: 5;"
battery="status: 1.0;" />
</a-scene>
Also, JavaScript.
AFRAME.registerComponent('path', {� schema: {radius: {default: 1}},� init: function () {� this.position = new THREE.Vector3();� },� tick: function (t) {� this.position.x = Math.sin(t / 1000);
this.position.z = Math.cos(t / 1000);
this.position.multiplyScalar(this.data.radius);� this.el.setAttribute('position', this.position);� }�});
Also, JavaScript.
AFRAME.registerComponent('battery', {� schema: {status: {default: 1.0}},� init: function () { … },� tick: function (t, dt) {
this.data.status -= 0.0001 * dt;
if (this.data.status <= 0) {
this.el.components.path.pause();
this.el.emit('explode');
}
}�});
Community Components
Resources
Website: aframe.io
GitHub: github.com/aframevr/aframe
Slack: aframevr-slack.herokuapp.com
Twitter: @aframevr
@donrmccurdy
Thanks!
Entity Component System (ECS).
Pattern from Game Development.
Composition > Inheritance.
By @rubenmueller
Miscellaneous
MagicaVoxel: ephtracy.github.io
StackOverflow: #aframe
WebVR Boilerplate: github.com/borismus/webvr-boilerplate
Chrome builds: webvr.info/get-chrome/