Spaces:
Running
Running
Update app.py
Browse files
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 |
}
|