From 4cf9c0b1485d199c853128ffa75abe92a97c16a1 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Sun, 2 Apr 2023 18:08:18 +0200 Subject: [PATCH] optimized model, AFrame version bump with rotation fixed --- index.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index fa45b55..d8910a8 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ + @@ -121,7 +122,7 @@ const zeroVector3 = new THREE.Vector3() var bbox = new THREE.Box3() bbox.min.copy( zeroVector3 ) bbox.max.copy( zeroVector3 ) -var selectionBox = new THREE.BoundingBoxHelper( bbox.object3D, 0x0000ff); +var selectionBox = new THREE.BoxHelper( bbox.object3D, 0x0000ff); var groupHelpers = [] var primaryPinchStarted = false var visible = true @@ -816,7 +817,7 @@ function addBackgroundBoxToTextElements( textElements ){ function addBoundingBoxToTextElement( el ){ var meshEl = el.object3D.children.filter( e => (e.type == "Mesh") )[0] - var helper = new THREE.BoundingBoxHelper(meshEl, 0xff0000); + var helper = new THREE.BoxHelper(meshEl, 0xff0000); // otherwise doesn't work with icon... helper.update(); AFRAME.scenes[0].object3D.add(helper); @@ -1053,7 +1054,7 @@ AFRAME.registerComponent('pinchprimary', { // currently only 1 hand, the right o selectedElement.setAttribute("position", event.detail.position) document.querySelector("#rightHand").object3D.traverse( e => { if (e.name == "b_"+sides[primarySide][0]+"_wrist") - selectedElement.setAttribute("rotation", e.rotation.x*180/3.14 + " " + e.rotation.y*180/3.14 + " " + e.rotation.z*180/3.14) + selectedElement.setAttribute("rotation", e.rotation._x*180/3.14 + " " + e.rotation._y*180/3.14 + " " + e.rotation._z*180/3.14) }) // rotation isn't ideal with the wrist as tend not have wrist flat as we pinch } @@ -2200,7 +2201,7 @@ function highlight(code = `console.log("Here is your code."); var x = 5;`, langu function startExperience(){ //addCodeEditor(" \n\nqwe qwe qwe qwe qwe qwe qwe qweqweqwe\n\n\na", "") //addCodeEditor() - fetch("https://fabien.benetou.fr/pub/home/future_of_text_demo/engine/colorme.js").then(r=>r.text()).then( page => { addCodeEditor( page ) }) + fetch("colorme.js").then(r=>r.text()).then( page => { addCodeEditor( page ) }) //fetch("https://fabien.benetou.fr/Tools/Docker?action=source").then(r=>r.text()).then( page => { addCodeEditor( page, "" ) }) if (AFRAME.utils.device.checkHeadsetConnected()) AFRAME.scenes[0].enterVR(); @@ -3035,7 +3036,7 @@ AFRAME.registerComponent('startfunctions', { - +