freealise commited on
Commit
ef8a9b0
1 Parent(s): e52122a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -621,6 +621,7 @@ with gr.Blocks(css=css) as demo:
621
  const dir = BABYLON.Engine.LastCreatedScene.activeCamera.getForwardRay().direction;
622
  dir.y = 0; dir.normalize();
623
  const angle = BABYLON.Vector3.GetAngleBetweenVectors(dir, BABYLON.Vector3.Forward(), BABYLON.Vector3.Up());
 
624
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.z = (event.clientX-this.getBoundingClientRect().x-parseInt(this.style.width)/2) * Math.cos(-angle);
625
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = (event.clientY-this.getBoundingClientRect().y-parseInt(this.style.height)/2) * Math.sin(-angle);
626
  }
 
621
  const dir = BABYLON.Engine.LastCreatedScene.activeCamera.getForwardRay().direction;
622
  dir.y = 0; dir.normalize();
623
  const angle = BABYLON.Vector3.GetAngleBetweenVectors(dir, BABYLON.Vector3.Forward(), BABYLON.Vector3.Up());
624
+ alert(angle);
625
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.z = (event.clientX-this.getBoundingClientRect().x-parseInt(this.style.width)/2) * Math.cos(-angle);
626
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = (event.clientY-this.getBoundingClientRect().y-parseInt(this.style.height)/2) * Math.sin(-angle);
627
  }