Upgrade to Pro — share decks privately, control downloads, hide ads and more …

EmberConf 2017 Ember VR

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Kelly Selden Kelly Selden
March 29, 2017
420

EmberConf 2017 Ember VR

Avatar for Kelly Selden

Kelly Selden

March 29, 2017

Transcript

  1. <a-scene> <a-sphere position="0 1.25 -1" radius="1.25" color="#EF2D5E"> </a-sphere> <a-box position="-1

    0.5 1" rotation="0 45 0" width="1" height="1" depth="1" color="#4CC3D9"> </a-box> <a-cylinder position="1 0.75 1" radius="0.5" height="1.5" color="#FFC65D"> </a-cylinder> <a-plane rotation="-90 0 0" width="4" height="4" color="#7BC8A4"> </a-plane> <a-sky color="#ECECEC"></a-sky> <a-entity position="0 0 3.8"> <a-camera></a-camera> </a-entity> </a-scene> A-Frame
  2. <a-scene> <a-sphere position="0 1.25 -1" radius="1.25" color="#EF2D5E"> </a-sphere> <a-box position="-1

    0.5 1" rotation="0 45 0" width="1" height="1" depth="1" color="#4CC3D9"> </a-box> <a-cylinder position="1 0.75 1" radius="0.5" height="1.5" color="#FFC65D"> </a-cylinder> <a-plane rotation="-90 0 0" width="4" height="4" color="#7BC8A4"> </a-plane> <a-sky color="#ECECEC"></a-sky> <a-entity position="0 0 3.8"> <a-camera></a-camera> </a-entity> </a-scene> A-Frame + Ember
  3. A-Frame + Ember + Components {{a-scene}} {{a-sphere position="0 1.25 -1"

    radius="1.25" color=“#EF2D5E”}} {{a-box position="-1 0.5 1" rotation="0 45 0" width="1" height="1" depth="1" color="#4CC3D9"}} {{a-cylinder position="1 0.75 1" radius="0.5" height="1.5" color="#FFC65D"}} {{a-plane rotation="-90 0 0" width="4" height="4" color="#7BC8A4"}} {{a-sky color="#ECECEC"}} {{#a-entity position="0 0 3.8"}} {{a-camera}} {{/a-entity}} {{/a-scene}}
  4. Components import ASky from 'ember-a-frame/components/a-sky'; import stringifyComponent from 'ember-a-frame/macros/stringify-component'; import

    raw from 'ember-macro-helpers/raw'; import { task, timeout } from 'ember-concurrency'; export default ASky.extend({ animation: stringifyComponent('animation', { property: raw('material.color'), startEvents: raw('set-image-fade'), dir: raw('alternate'), dur: 'dur', from: raw('#FFF'), to: raw('#000') }), changeMaterialTask: task(function * (src) { yield timeout(this.get('dur')); this.sendAction('changeMaterial', src); }), actions: { startChangingMaterial(src) { this.element.emit('run-animation'); this.get('changeMaterialTask').perform(src); } } });
  5. Components import ASky from 'ember-a-frame/components/a-sky'; import stringifyComponent from 'ember-a-frame/macros/stringify-component'; import

    raw from 'ember-macro-helpers/raw'; import { task, timeout } from 'ember-concurrency'; export default ASky.extend({ animation: stringifyComponent('animation', { property: raw('material.color'), startEvents: raw('set-image-fade'), dir: raw('alternate'), dur: 'dur', from: raw('#FFF'), to: raw('#000') }), changeMaterialTask: task(function * (src) { yield timeout(this.get('dur')); this.sendAction('changeMaterial', src); }), actions: { startChangingMaterial(src) { this.element.emit('run-animation'); this.get('changeMaterialTask').perform(src); } } });
  6. Components import ASky from 'ember-a-frame/components/a-sky'; import stringifyComponent from 'ember-a-frame/macros/stringify-component'; import

    raw from 'ember-macro-helpers/raw'; import { task, timeout } from 'ember-concurrency'; export default ASky.extend({ animation: stringifyComponent('animation', { property: raw('material.color'), startEvents: raw('set-image-fade'), dir: raw('alternate'), dur: 'dur', from: raw('#FFF'), to: raw('#000') }), changeMaterialTask: task(function * (src) { yield timeout(this.get('dur')); this.sendAction('changeMaterial', src); }), actions: { startChangingMaterial(src) { this.element.emit('run-animation'); this.get('changeMaterialTask').perform(src); } } });
  7. Components import ASky from 'ember-a-frame/components/a-sky'; import stringifyComponent from 'ember-a-frame/macros/stringify-component'; import

    raw from 'ember-macro-helpers/raw'; import { task, timeout } from 'ember-concurrency'; export default ASky.extend({ animation: stringifyComponent('animation', { property: raw('material.color'), startEvents: raw('set-image-fade'), dir: raw('alternate'), dur: 'dur', from: raw('#FFF'), to: raw('#000') }), changeMaterialTask: task(function * (src) { yield timeout(this.get('dur')); this.sendAction('changeMaterial', src); }), actions: { startChangingMaterial(src) { this.element.emit('run-animation'); this.get('changeMaterialTask').perform(src); } } });
  8. Components import ASky from 'ember-a-frame/components/a-sky'; import stringifyComponent from 'ember-a-frame/macros/stringify-component'; import

    raw from 'ember-macro-helpers/raw'; import { task, timeout } from 'ember-concurrency'; export default ASky.extend({ animation: stringifyComponent('animation', { property: raw('material.color'), startEvents: raw('set-image-fade'), dir: raw('alternate'), dur: 'dur', from: raw('#FFF'), to: raw('#000') }), changeMaterialTask: task(function * (src) { yield timeout(this.get('dur')); this.sendAction('changeMaterial', src); }), actions: { startChangingMaterial(src) { this.element.emit('run-animation'); this.get('changeMaterialTask').perform(src); } } });
  9. Side Note: API Synchronization •Last resort is to maintain a

    copied API •Initializers register components? •Solution: Broccoli!