Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -619,8 +619,8 @@ with gr.Blocks(css=css) as demo:
|
|
619 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion = null;
|
620 |
}
|
621 |
var rotation = BABYLON.Engine.LastCreatedScene.activeCamera.rotation.y;
|
622 |
-
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)
|
623 |
-
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)
|
624 |
}
|
625 |
} catch(e) {alert(e)}
|
626 |
' onkeydown='
|
@@ -629,7 +629,7 @@ with gr.Blocks(css=css) as demo:
|
|
629 |
var evt = document.createEvent(\"Event\");
|
630 |
evt.initEvent(\"click\", true, false);
|
631 |
document.getElementById(\"reset_cam\").dispatchEvent(evt);
|
632 |
-
}
|
633 |
event.preventDefault();
|
634 |
if (BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion) {
|
635 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion = null;
|
|
|
619 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion = null;
|
620 |
}
|
621 |
var rotation = BABYLON.Engine.LastCreatedScene.activeCamera.rotation.y;
|
622 |
+
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.sin(rotation);
|
623 |
+
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.cos(rotation);
|
624 |
}
|
625 |
} catch(e) {alert(e)}
|
626 |
' onkeydown='
|
|
|
629 |
var evt = document.createEvent(\"Event\");
|
630 |
evt.initEvent(\"click\", true, false);
|
631 |
document.getElementById(\"reset_cam\").dispatchEvent(evt);
|
632 |
+
}
|
633 |
event.preventDefault();
|
634 |
if (BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion) {
|
635 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion = null;
|