I have a code that uses web camera to track body parts for the browser. I would like to be able to manipulate image on canvas with the body part coordinates (x, y ,z). If I draw canvas element like a circle and request it to track my nose it works but when I try the same thing with an image it won't move at all.
function drawImage(canvas, x, y) {
var ctx = canvas.getContext('2d');
var img = new Image();
img.addEventListener('load', function(){
ctx.drawImage(img, 0, 0);
});
img.src = 'noIdea.jpg';
}
Here I call for the function:
drawImage(canvasEl,nose.position.x, nose.position.y);