The document discusses using facial tracking with AI and WebXR to create a pseudo-3D representation. It provides steps to download sample files and setup, then explains using MediaPipe and TensorFlow to implement real-time facial recognition and link the camera position to the detected face position, creating a sense of 3D. Code snippets are included to initialize the model, start face tracking each frame, and display the 3D scene and camera video feed.
The document discusses using facial tracking with AI and WebXR to create a pseudo-3D representation. It provides steps to download sample files and setup, then explains using MediaPipe and TensorFlow to implement real-time facial recognition and link the camera position to the detected face position, creating a sense of 3D. Code snippets are included to initialize the model, start face tracking each frame, and display the 3D scene and camera video feed.
77. 描画したBoxを削除
var prev;//最後にBox置いた位置を記憶
window.onload = function() {
/*省略*/
};
//右手の初期化を行う関数
function initRightHand(){
/*省略*/
};
//左手の初期化を行う関数
function initLeftHand(){
};
//Boxの追加を行う関数
function addBox(position){
/*省略*/
}
ここを編集
78. 描画したBoxを削除
function initLeftHand(){
//左手のオブジェクトを取得
leftHand = document.getElementById("leftHand");
//ピンチ開始時の挙動
leftHand.addEventListener('pinchstarted', function (e) {
//boxクラスが割り当てられているオブジェクトを全て取得
var els = document.querySelectorAll('.box’);
//一つ一つ削除していく
for (var i = 0; i < els.length; i++) {
els[i].parentNode.removeChild(els[i]);
}
});
};
Lesson14