Skip to content

Commit 35fe1a8

Browse files
zenorochaeduardolundgren
authored andcommitted
decreasing the number of lines
1 parent c992adc commit 35fe1a8

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

examples/move_threejs_camaro.html

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,20 @@
3131
<script>
3232
var mouseX, mouseY, videoCamera = new tracking.VideoCamera().hide().render().renderVideoCanvas('#videoContainer');
3333

34-
videoCamera.track(
35-
{
36-
type: 'color',
37-
color: 'magenta',
38-
onFound: function(track) {
39-
var x = track.x,
40-
y = track.y;
41-
42-
if (x && y) {
43-
mouseX = ((320 - track.x)/320)*window.innerWidth - window.innerWidth/2,
44-
mouseY = ((240 - track.y)/240)*window.innerHeight - window.innerHeight;
45-
}
46-
},
47-
onNotFound: function() {
34+
videoCamera.track({
35+
type: 'color',
36+
color: 'magenta',
37+
onFound: function(track) {
38+
var x = track.x,
39+
y = track.y;
40+
41+
if (x && y) {
42+
mouseX = ((320 - track.x)/320)*window.innerWidth - window.innerWidth/2,
43+
mouseY = ((240 - track.y)/240)*window.innerHeight - window.innerHeight;
4844
}
49-
}
50-
);
45+
},
46+
onNotFound: function() {}
47+
});
5148
</script>
5249

5350
</body>

0 commit comments

Comments
 (0)