From 6378796456c5e3eeb3de017948b8a4cd63f2e8e0 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Tue, 14 Feb 2023 08:04:03 +0100 Subject: [PATCH] preparing VR movement bindings --- index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.html b/index.html index a922431..af98693 100644 --- a/index.html +++ b/index.html @@ -2401,6 +2401,17 @@ function addMannequins(){ // but must consider how to use rotation too, not just position // must rely on its own system in order to respect constraints, if defined +let people +async function moveMannequinPartExample(mannequin=0){ + testPoints = await fetch("pointsFromMovementExample.json").then( r => r.json() ) + // to replace by nextMovementToPoints() then pointsFromMovement + let first = new THREE.Vector3( ).copy( testPoints[0] ) + let last = new THREE.Vector3( ).copy( testPoints[testPoints.length-1]) + let distance = first.distanceTo( last ) + if (!people) people = addMannequins() + people[mannequin].head.tilt -= distance +} +