Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -606,22 +606,7 @@ async(p, d, n)=>{
|
|
606 |
if (document.getElementById("iframe3D")===null || typeof document.getElementById("iframe3D")==="undefined") {
|
607 |
if (BABYLON && BABYLON.Engine.LastCreatedScene) {
|
608 |
BABYLON.Engine.LastCreatedScene.onAfterRenderObservable.add(function() { //onDataLoadedObservable
|
609 |
-
|
610 |
-
var then = new Date().getTime();
|
611 |
-
var now, delta;
|
612 |
-
const interval = 1000 / 25;
|
613 |
-
const tolerance = 0.1;
|
614 |
-
function rndr() {
|
615 |
-
now = new Date().getTime();
|
616 |
-
delta = now - then;
|
617 |
-
then = now - (delta % interval);
|
618 |
-
if (delta >= interval - tolerance && BABYLON.Engine.LastCreatedScene && BABYLON.Engine.LastCreatedScene.activeCamera) {
|
619 |
-
BABYLON.Engine.LastCreatedScene.render();
|
620 |
-
requestAnimationFrame(rndr);
|
621 |
-
}
|
622 |
-
}
|
623 |
-
rndr();
|
624 |
-
|
625 |
var bg = JSON.parse(document.getElementById("bgcolor").getElementsByTagName("textarea")[0].value);
|
626 |
BABYLON.Engine.LastCreatedScene.getEngine().setHardwareScalingLevel(1.0);
|
627 |
for (var i=0; i<bg.length; i++) {
|
@@ -630,7 +615,6 @@ async(p, d, n)=>{
|
|
630 |
BABYLON.Engine.LastCreatedScene.clearColor = new BABYLON.Color4(bg[0], bg[1], bg[2], bg[3]);
|
631 |
BABYLON.Engine.LastCreatedScene.autoClear = false;
|
632 |
BABYLON.Engine.LastCreatedScene.autoClearDepthAndStencil = false;
|
633 |
-
BABYLON.Engine.LastCreatedScene.getAnimationRatio();
|
634 |
for (var i=0; i<BABYLON.Engine.LastCreatedScene.getNodes().length; i++) {
|
635 |
if (BABYLON.Engine.LastCreatedScene.getNodes()[i].material) {
|
636 |
BABYLON.Engine.LastCreatedScene.getNodes()[i].material.pointSize = Math.ceil(Math.log2(Math.PI/document.getElementById("zoom").value));
|
@@ -654,7 +638,15 @@ async(p, d, n)=>{
|
|
654 |
BABYLON.Engine.LastCreatedScene.removeMesh(m);
|
655 |
}
|
656 |
} catch(e) {alert(e);}
|
|
|
657 |
BABYLON.Engine.LastCreatedScene.activeCamera.inertia = 0.0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
658 |
});
|
659 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
660 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
|
|
|
606 |
if (document.getElementById("iframe3D")===null || typeof document.getElementById("iframe3D")==="undefined") {
|
607 |
if (BABYLON && BABYLON.Engine.LastCreatedScene) {
|
608 |
BABYLON.Engine.LastCreatedScene.onAfterRenderObservable.add(function() { //onDataLoadedObservable
|
609 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
610 |
var bg = JSON.parse(document.getElementById("bgcolor").getElementsByTagName("textarea")[0].value);
|
611 |
BABYLON.Engine.LastCreatedScene.getEngine().setHardwareScalingLevel(1.0);
|
612 |
for (var i=0; i<bg.length; i++) {
|
|
|
615 |
BABYLON.Engine.LastCreatedScene.clearColor = new BABYLON.Color4(bg[0], bg[1], bg[2], bg[3]);
|
616 |
BABYLON.Engine.LastCreatedScene.autoClear = false;
|
617 |
BABYLON.Engine.LastCreatedScene.autoClearDepthAndStencil = false;
|
|
|
618 |
for (var i=0; i<BABYLON.Engine.LastCreatedScene.getNodes().length; i++) {
|
619 |
if (BABYLON.Engine.LastCreatedScene.getNodes()[i].material) {
|
620 |
BABYLON.Engine.LastCreatedScene.getNodes()[i].material.pointSize = Math.ceil(Math.log2(Math.PI/document.getElementById("zoom").value));
|
|
|
638 |
BABYLON.Engine.LastCreatedScene.removeMesh(m);
|
639 |
}
|
640 |
} catch(e) {alert(e);}
|
641 |
+
BABYLON.Engine.LastCreatedScene.getAnimationRatio();
|
642 |
BABYLON.Engine.LastCreatedScene.activeCamera.inertia = 0.0;
|
643 |
+
BABYLON.Engine.LastCreatedScene.getMeshByName(\"dome_mesh\").convertToUnIndexedMesh();
|
644 |
+
BABYLON.Engine.LastCreatedScene.getMeshByName(\"dome_mesh\").material.freeze();
|
645 |
+
BABYLON.Engine.LastCreatedScene.getMeshByName(\"dome_mesh\").freezeWorldMatrix();
|
646 |
+
BABYLON.Engine.LastCreatedScene.getMeshByName(\"dome_mesh\").alwaysSelectAsActiveMesh = true;
|
647 |
+
BABYLON.Engine.LastCreatedScene.getMeshByName(\"dome_mesh\").doNotSyncBoundingInfo = true;
|
648 |
+
BABYLON.Engine.LastCreatedScene.freezeActiveMeshes();
|
649 |
+
BABYLON.Engine.LastCreatedScene.skipPointerMovePicking = true;
|
650 |
});
|
651 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
652 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
|