diff --git a/index.html b/index.html index a2d7eda..782af04 100644 --- a/index.html +++ b/index.html @@ -2468,6 +2468,28 @@ function sendPerspectiveToServer(){ }, "image/jpeg", 0.8); } +function doublePinchToScale(){ + let initialPositionSecondary + let elSecondary = document.querySelector('[pinchsecondary]') + elSecondary.addEventListener('pinchmoved', movedSecondary ); + function movedSecondary(event){ + if (!selectedElement) return + let scale = initialPositionSecondary.distanceTo(event.detail.position) + selectedElement.setAttribute("scale", ""+scale+" "+scale+" "+scale+" ") + } + elSecondary.addEventListener('pinchstarted', startedSecondary ); + function startedSecondary(event){ + initialPositionSecondary = event.detail.position.clone() + } +} + +// used for testing +AFRAME.registerComponent('startfunctions', { + init: function () { + doublePinchToScale() + } +}) +
@@ -2477,6 +2499,7 @@ function sendPerspectiveToServer(){