Skip to content

Commit 6c97975

Browse files
committed
draw something example added
1 parent a7b7dba commit 6c97975

3 files changed

Lines changed: 55 additions & 42 deletions

File tree

examples/img/iphone.png

164 KB
Loading

examples/move_controller_plot.html

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/move_draw_something.html

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!doctype html>
2+
3+
<html>
4+
<head>
5+
<title>Draw Something</title>
6+
7+
<script type="text/javascript" src="../src/tracking.js"></script>
8+
<script type="text/javascript" src="../src/tracker/color.js"></script>
9+
<script type="text/javascript" src="js/splines.js"></script>
10+
11+
<style type="text/css">
12+
canvas {
13+
-moz-transform: scale(-1, 1);
14+
-o-transform: scale(-1, 1);
15+
-webkit-transform: scale(-1, 1);
16+
filter: FlipH;
17+
transform: scale(-1, 1);
18+
position: absolute;
19+
top: 305px;
20+
left: 54px;
21+
}
22+
#iphoneContainer {
23+
width: 425px;
24+
height: 757px;
25+
margin: 0 auto;
26+
position: relative;
27+
background: url(img/iphone.png);
28+
}
29+
30+
</style>
31+
</head>
32+
<body>
33+
34+
<div id="iphoneContainer"></div>
35+
36+
<script>
37+
var videoCamera = new tracking.VideoCamera().hide().render().renderVideoCanvas('#iphoneContainer');
38+
39+
var plotCanvas = new tracking.Canvas().render(),
40+
drawPoints = [];
41+
42+
videoCamera.track(
43+
{
44+
type: 'color',
45+
color: 'cyan',
46+
callback: function(tracking) {
47+
drawPoints.push(tracking.x, tracking.y);
48+
drawSpline(videoCamera.canvas.context, drawPoints, 0.5, false);
49+
}
50+
}
51+
);
52+
</script>
53+
54+
</body>
55+
</html>

0 commit comments

Comments
 (0)