Skip to content

Commit f4f49fc

Browse files
author
Zeno Rocha
committed
Merge pull request eduardolundgren#18 from zenorocha/docs
Adding a simple Getting Started guide based on Hello World example
2 parents f943594 + b09619f commit f4f49fc

1 file changed

Lines changed: 41 additions & 2 deletions

File tree

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
1-
## tracking.js
2-
### Change the way you interact with your browser
1+
# tracking.js
2+
3+
Change the way you interact with your browser.
4+
5+
## Getting Started
6+
7+
Import the core library:
8+
9+
``` html
10+
<script src="tracking.js"></script>
11+
```
12+
13+
Import the color module:
14+
15+
``` html
16+
<script src="tracker/color.js"></script>
17+
```
18+
19+
Gets the user's camera:
20+
21+
``` javascript
22+
var videoCamera = new tracking.VideoCamera().render();
23+
```
24+
25+
Instantiates tracking by color magenta and displays X, Y and Z positions of the detected area in console:
26+
27+
28+
``` javascript
29+
videoCamera.track({
30+
type: 'color',
31+
color: 'magenta',
32+
onFound: function(track) {
33+
console.log(track.x, track.y, track.z);
34+
},
35+
onNotFound: function() {}
36+
});
37+
```
38+
39+
[Check the full code of this Hello World example.](https://github.com/eduardolundgren/tracking.js/blob/master/examples/hello_world.html)
40+
41+
## About
342

443
It brings to web elements tracking techniques of a real scene captured by the camera, through natural interactions from object tracking, color markers, among others, allowing the development of interfaces and games through a simple and intuitive API.
544

0 commit comments

Comments
 (0)