Update app.py
Browse files
app.py
CHANGED
@@ -594,8 +594,7 @@ async(c, o, p, d, n, m, s)=>{
|
|
594 |
BABYLON.Engine.LastCreatedScene.getAnimationRatio();
|
595 |
});
|
596 |
var CoT = new BABYLON.TransformNode("root");
|
597 |
-
BABYLON.Engine.LastCreatedScene.activeCamera = new BABYLON.ArcRotateCamera("camera", 0, Math.PI / 2, 1.0, new BABYLON.Vector3(0, 0, 0))
|
598 |
-
CoT.parent = BABYLON.Engine.LastCreatedScene.activeCamera;
|
599 |
BABYLON.Engine.LastCreatedScene.activeCamera.target = CoT;
|
600 |
|
601 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
@@ -695,7 +694,8 @@ async(c, o, p, d, n, m, s)=>{
|
|
695 |
//BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromEmissiveTexture = true;
|
696 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].alphaIndex = 1;
|
697 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].visibility = 0.9999;
|
698 |
-
|
|
|
699 |
window.md = false;
|
700 |
window.r_old = 1.0;
|
701 |
window.a_old = 0;
|
@@ -713,6 +713,9 @@ async(c, o, p, d, n, m, s)=>{
|
|
713 |
if (md === true) {
|
714 |
x = parseInt(evt.clientX - evt.target.getBoundingClientRect().x);
|
715 |
y = parseInt(evt.clientY - evt.target.getBoundingClientRect().y);
|
|
|
|
|
|
|
716 |
|
717 |
if (Math.abs(x-xold)>16 || Math.abs(y-yold)>16) {
|
718 |
if (Math.abs(BABYLON.Engine.LastCreatedScene.activeCamera.radius) > 16) {
|
|
|
594 |
BABYLON.Engine.LastCreatedScene.getAnimationRatio();
|
595 |
});
|
596 |
var CoT = new BABYLON.TransformNode("root");
|
597 |
+
BABYLON.Engine.LastCreatedScene.activeCamera = new BABYLON.ArcRotateCamera("camera", 0, Math.PI / 2, 1.0, new BABYLON.Vector3(0, 0, 0))
|
|
|
598 |
BABYLON.Engine.LastCreatedScene.activeCamera.target = CoT;
|
599 |
|
600 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
|
|
694 |
//BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromEmissiveTexture = true;
|
695 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].alphaIndex = 1;
|
696 |
BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].visibility = 0.9999;
|
697 |
+
|
698 |
+
window.CoT = CoT;
|
699 |
window.md = false;
|
700 |
window.r_old = 1.0;
|
701 |
window.a_old = 0;
|
|
|
713 |
if (md === true) {
|
714 |
x = parseInt(evt.clientX - evt.target.getBoundingClientRect().x);
|
715 |
y = parseInt(evt.clientY - evt.target.getBoundingClientRect().y);
|
716 |
+
CoT.rotation.y = BABYLON.Engine.LastCreatedScene.activeCamera.alpha;
|
717 |
+
CoT.rotation.x = BABYLON.Engine.LastCreatedScene.activeCamera.beta;
|
718 |
+
CoT.position.z = BABYLON.Engine.LastCreatedScene.activeCamera.radius;
|
719 |
|
720 |
if (Math.abs(x-xold)>16 || Math.abs(y-yold)>16) {
|
721 |
if (Math.abs(BABYLON.Engine.LastCreatedScene.activeCamera.radius) > 16) {
|