more examples of nextMovementToPoints() usage

swagger_example
Fabien Benetou 2 years ago
parent 9b776462c6
commit 4f72cc08be
  1. 12
      index.html

@ -2248,13 +2248,21 @@ function nextMovementToPoints(debut=false){
/*
could be a promise also
see examples for debugging/dev
//see examples for debugging/dev
testPoints = await fetch("pointsFromMovementExample.json").then( r => r.json() )
could also otherwise down sample
//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]) } )
*/
}

Loading…
Cancel
Save