From 4f72cc08be564cff79e85ed88c2365307df541d1 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Tue, 31 Jan 2023 04:09:35 +0100 Subject: [PATCH] more examples of nextMovementToPoints() usage --- index.html | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index d4dd064..b9c60fb 100644 --- a/index.html +++ b/index.html @@ -2245,17 +2245,25 @@ function nextMovementToPoints(debut=false){ pointsFromMovement.push( event.detail.position.clone() ) } - /* - could be a promise also - - see examples for debugging/dev - testPoints = await fetch("pointsFromMovementExample.json").then( r => r.json() ) - could also otherwise down sample - let first = new THREE.Vector3( ).copy( testPoints[0] ) - let last = new THREE.Vector3( ).copy( testPoints[testPoints.length-1]) - let distance = first.distanceTo( last ) - let direction = new THREE.Vector3().subVectors( last, first ).normalize() - */ +/* +could be a promise also + +//see examples for debugging/dev +testPoints = await fetch("pointsFromMovementExample.json").then( r => r.json() ) + +//could also otherwise down sample +let first = new THREE.Vector3( ).copy( testPoints[0] ) +let last = new THREE.Vector3( ).copy( testPoints[testPoints.length-1]) +let distance = first.distanceTo( last ) +let direction = new THREE.Vector3().subVectors( last, first ).normalize() + +//example of adding on curve +testPoints.map( p => addNewNote("something "+Math.random(), p) ) + +//example of animating from start to end +nn = addNewNote("something", testPoints[0]); +nn.setAttribute("animation", {property: "position" , to: AFRAME.utils.coordinates.stringify(testPoints[testPoints.length-1]) } ) +*/ } function addDropZone(position="0 1.4 -0.6", callback=setFeedbackHUD, radius=0.11){