ai_creativity_design/Expressive_Movement/main.js
// A function to draw the skeletons
A function to draw the skeletons
A function to draw the skeletons
function drawSkeleton() {
    for (let i = 0; i < poses.length; i++) {
        let skeleton = poses[i].skeleton;
        for (let j = 0; j < skeleton.length; j++) {
            let partA = skeleton[j][0];
            let partB = skeleton[j][1];
            stroke(75, 0, 130);
            strokeWeight(3);
            line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);
            beginShape();
            curveVertex(partA.position.x, partA.position.y);
            curveVertex(partB.position.x, partB.position.y);
            endShape();
        }
    }
}
function drawSkeleton ( ) { for ( let i = 0 ; i < poses . length ; i ++ ) { let skeleton = poses [ i ] . skeleton ; for ( let j = 0 ; j < skeleton . length ; j ++ ) { let partA = skeleton [ j ] [ 0 ] ; let partB = skeleton [ j ] [ 1 ] ; stroke ( 75 , 0 , 130 ) ; strokeWeight ( 3 ) ; line ( partA . position . x , partA . position . y , partB . position . x , partB . position . y ) ; beginShape ( ) ; curveVertex ( partA . position . x , partA . position . y ) ; curveVertex ( partB . position . x , partB . position . y ) ; endShape ( ) ; } } }
A function to draw the skeletons
A function to draw the skeletons
// Loop through all the skeletons detected // For every skeleton, loop through all body connections