Skip to content

Instantly share code, notes, and snippets.

@bwhite
Created April 11, 2014 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwhite/10510213 to your computer and use it in GitHub Desktop.
Save bwhite/10510213 to your computer and use it in GitHub Desktop.
[wearscript] New registration code
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function main() {
if (WS.scriptVersion(1)) return;
var arModel = 'kYKia3eApG5hbWW4cGljYXJ1cy5BUk1hcmtlckRldGVjdG9y';
WS.log('Started')
WS.cvInit(function () {
WS.log('inited');
var model = new WS.PicarusModel(arModel, function () {
WS.say('Loaded');
model.processStream(function (tags) {
tags = msgpack.unpack(tags)[0];
WS.log(JSON.stringify(tags));
var numTags = tags.length / 9;
if (numTags) {
var tagString = 'Tags ';
for (var i = 0; i < numTags; i++)
tagString += tags[i * 9] + ' ';
WS.say(tagString);
}
});
});
});
WS.cameraOn(.1, 360, 640);
}
window.onload = main;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment