sketches/audiocontroller/js/sketch.js
/**
 * Draw pose keypoints onto a canvas
 */
Draw pose keypoints onto a canvas
Draw pose keypoints onto a canvas
function drawKeypoints(keypoints, minConfidence, ctx, scale = 1) {
  for (let i = 0; i < keypoints.length; i++) {
    const keypoint = keypoints[i];
    if (keypoint.score < minConfidence) {
      continue;
    }
    const {y, x} = keypoint.position;
    drawPoint(ctx, y * scale, x * scale, 5, color);
  }
}
function drawKeypoints ( keypoints , minConfidence , ctx , scale = 1 ) { for ( let i = 0 ; i < keypoints . length ; i ++ ) { const keypoint = keypoints [ i ] ; if ( keypoint . score < minConfidence ) { continue ; } const { y , x } = keypoint . position ; drawPoint ( ctx , y * scale , x * scale , 5 , color ) ; } }
Draw pose keypoints onto a canvas
Draw pose keypoints onto a canvas