|
1 | 1 | Augmented Reality
|
2 | 2 | =================
|
3 | 3 |
|
| 4 | +While Glass has a relatively small display and won't be able to create full immersive overlays, there are several interesting applications of AR that have been under-explored. We have put together the building blocks to get you started, this will require understanding how they work to use them properly and this module is highly experimental. |
4 | 5 |
|
| 6 | +.. figure:: ardimensions.png |
| 7 | + :alt: Glass Prism, Photo, Preview (640x360) relationships |
| 8 | + |
| 9 | + This shows the relationship between the Prism, Photo, and Preview (640x360) images. |
| 10 | + |
| 11 | +displayWarpView([Array hBigToGlass]) : void |
| 12 | + Warps each preview image to the display such that it overlaps with what the user sees (works for objects > 7ft away, currently supported resolutions are 640x360 and 1280x720). If the hBigToGlass homography is not provided a default is used; however, it won't match perfectly, each Glass is slightly different and they only need to be calibrated once. |
| 13 | + |
| 14 | +warpPreviewSampleGlass([Function callback]) : void |
| 15 | + Publishes the next preview image it gets, AR server uses it to match subsequent images to, a local copy is stored and can be drawn on using WS.warpDraw. |
| 16 | + |
| 17 | + * Callback has parameters of the form function `callback(Homography array)` |
| 18 | + |
| 19 | +warpDraw(x, y, radius, r, g, b) : void |
| 20 | + Draws a circle on the sample image |
| 21 | + |
| 22 | + |
| 23 | +.. code-block:: guess |
| 24 | +
|
| 25 | + function server() { |
| 26 | + WS.cameraOn(1.2, 360, 640); |
| 27 | + WS.displayWarpView(); |
| 28 | + function sample() { |
| 29 | + setTimeout(function (){ |
| 30 | + WS.warpDraw(640 / 2, 360 / 2, 10, 255, 0, 0); |
| 31 | + }, 1500) |
| 32 | + WS.warpPreviewSampleGlass(''); |
| 33 | + } |
| 34 | + WS.dataLog(false, true, .15); |
| 35 | + WS.gestureCallback('onGesture', function (gesture) { |
| 36 | + if (gesture === 'TAP') { |
| 37 | + WS.sound('SUCCESS'); |
| 38 | + sample(); |
| 39 | + } |
| 40 | + }); |
| 41 | + } |
0 commit comments