An introduction to WebVR
Berlin - 10.08.2017
By Andrés Cuervo & Stefanie Doll
Microsoft Edge
Chrome for Android
Firefox
Chromium
Samsung Internet
Oculus Carmel
Servo
WebVR Polyfill
VR Headsets
Mobile Phone &
Cardboard
Tablets
Desktop
WebGL
Gampad
Web Audio
WebRTC
Geolocation
and more...
Entity Box = Geometry + Material + Position
Entity Ball = Geometry + Material + Position + Velocity + Physics
Entity is an empty container
<a-entity>
Components add a certain apperance, behaviour and/or functionality
System provides the global scope
<a-scene >
Setup of repetitive tasks & components needed
Go to: https://berlin-aframe-workshop.glitch.me
and click on the "Remix this project!" link
Then click "Show live" in the upper left corner and click on Lesson 1 "Playing with primitives".
ctrl + alt + i
It provides a basic shape for an entity
It gives appearance to an entity
Right-handed coordinate system
It places entities at certain spots in 3D space
Position is relative to <a-scene> or the parent-element.
It defines the orientation of an entity
#### Some other things to know: - default position for entities is "`0 0 0`" - the default camera position is "`0 1.6 0`" - Position is relative to a-scene or to the parent element
<a-animation>
component as a child
Use the 'src' attribute of the material component
You can use 3D-Objects in your A-Frame scenes.
Exports from Unity, Blender, Google Blocks, Sketchfab (...) and shared ressources.
Use together with the scale component
Models by "Anna dream brush" & Timothy 'YM' Johnson
<a-assets>
– <a-assets-item>
<a-mixin>
The ID of the asset or mixin is used as a refenrence on the entity.
Try to rebuild this scene!
Got back to the course overview and follow the links for Lesson 3.
See a pattern?
A-Frame is built on the concept of components:
Javascript that hooks into the component lifecycle (`init`, `tick`, `remove`, etc.).
Allows you to define more complicated behavior to make custom interactions, materials, & more!
AFRAME.registerComponent('my-color', {
schema : {
color : { default : '#DDAADD' }
},
init : function () {
this.el.setAttribute('material', 'color', this.data.color)}});
Register event listeners without Javascript
https://github.com/ngokevin/aframe-event-set-componenthttps://berlin-aframe-workshop.glitch.me/
Use the aframe-event-set-component
to change the color of the <a-box> on mouseenter and mouseleave.