HTML:
<a-entity camera
universal-controls="movementControls: custom, gamepad, keyboard">
</a-entity>
JS:
license: mit |
license: mit |
license: mit |
license: mit |
license: mit |
HTML:
<a-entity camera
universal-controls="movementControls: custom, gamepad, keyboard">
</a-entity>
JS:
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1"> | |
<title>Examples • Slow Mouse</title> | |
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script> | |
<script src="https://cdn.rawgit.com/donmccurdy/aframe-extras/v3.3.0/dist/aframe-extras.min.js"></script> | |
<script> | |
AFRAME.registerComponent('slowmouse-controls', { |
This effect system requires several of THREE.js's non-default post-processing and shader scripts.
UPDATE(10/9/2017): Check out aframe-effects; it's easier than what I've done here, and works in VR (which this Gist does not).
/** | |
* Creates a RegExp from the given string, converting asterisks to .* expressions, | |
* and escaping all other characters. | |
*/ | |
function wildcardToRegExp (s) { | |
return new RegExp('^' + s.split(/\*+/).map(regExpEscape).join('.*') + '$'); | |
} | |
/** | |
* RegExp-escapes all characters in the given string. |
license: apache-2.0 |