From 6ae4f08e57e7f5286bdd2255617d0d4f6c80019c Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Fri, 9 Jun 2023 06:52:53 +0200 Subject: [PATCH] example of touching with index to change entity --- index.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index bb3ffc7..41db328 100644 --- a/index.html +++ b/index.html @@ -3379,11 +3379,21 @@ function tensionVisualized(){ }, 20) } +function ontouch(){ + let p = document.querySelector('[pinchprimary]') + let ptarget = new THREE.Vector3(); // create once an reuse it + let indexesTipTracking = setInterval( _ => { + ptarget = p.components['hand-tracking-controls'].indexTipPosition + getClosestTargetElement( ptarget )?.setAttribute('wireframe', true) + }, 20) +} + // used for testing AFRAME.registerComponent('startfunctions', { init: function () { - tensionVisualized() + ontouch() + //tensionVisualized() //startExperience() //doublePinchToScale() //emptyPinchToMove() @@ -3460,6 +3470,7 @@ AFRAME.registerComponent('startfunctions', { --> +