Andrzej Mazur • @end3r • Enclave Games
FullStack London 2019, July 10th 2019
Mixed Reality = Virtual Reality + Augmented Reality
Keyboard and mouse, Leap Motion, Gamepad API, Device Orientation...
Framerate, camera, horizon...
Give reasons to look around.
You have to be "inside".
Editor's Draft: immersive-web.github.io/webxr
Use the tools instead:
Three.js, A-Frame, React360, Babylon.js, ...
<a-scene>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>A-Frame demo - cube</title>
<script src="aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-cube color="#0095DD" position="0 1 0" rotation="20 40 0"></a-cube>
</a-scene>
</body>
</html>
<a-camera>
, <a-light>
, <a-cylinder>
, <a-entity>
...
<a-entity
geometry="primitive: torus; radiusTubular: 0.1; segmentsTubular: 12;"
material="color: #EAEFF2; roughness: 0.1; metalness: 0.5;"
rotation="10 0 0"
position="-3 1 0">
</a-entity>
var scene = document.querySelector('a-scene');
var cylinder = document.createElement('a-cylinder');
cylinder.setAttribute('color', '#FF9500');
cylinder.setAttribute('height', '2');
cylinder.setAttribute('radius', '0.75');
cylinder.setAttribute('position', '3 1 0');
scene.appendChild(cylinder);
<a-cube color="#0095DD" rotation="20 40 0" position="0 1 0">
<a-animation
attribute="rotation"
from="20 0 0"
to="20 360 0"
direction="alternate"
dur="4000"
repeat="indefinite"
easing="ease">
</a-animation>
</a-cube>
var t = 0;
function render() {
t += 0.01;
requestAnimationFrame(render);
cylinder.setAttribute('position', '3 '+(Math.sin(t*2)+1)+' 0');
}
render();
Ctrl + Alt + i
15:45, Merging Realities by Fabien Benetou
end3r.com/slides/fullstack19-webxr