freealise commited on
Commit
c56fb09
1 Parent(s): b374feb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -439,7 +439,23 @@ on_click="""
439
  async()=>{
440
  var intv = setInterval(function(){
441
  if (BABYLON && BABYLON.Engine.LastCreatedScene) {
442
- alert(BABYLON.Engine.LastCreatedScene.activeCamera.fov);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  clearInterval(intv);
444
  }
445
  }, 40);
 
439
  async()=>{
440
  var intv = setInterval(function(){
441
  if (BABYLON && BABYLON.Engine.LastCreatedScene) {
442
+ for (var i=0; i<BABYLON.Engine.LastCreatedScene.getNodes().length; i++) {
443
+ if (BABYLON.Engine.LastCreatedScene.getNodes()[i].material) {
444
+ BABYLON.Engine.LastCreatedScene.getNodes()[i].material.pointSize = Math.ceil(Math.sqrt(2)*Math.log2(Math.PI/document.getElementById("zoom").value));
445
+ }
446
+ }
447
+ pipeline = new BABYLON.DefaultRenderingPipeline("default", true, BABYLON.Engine.LastCreatedScene, [BABYLON.Engine.LastCreatedScene.activeCamera]);
448
+ pipeline.samples = 4;
449
+ pipeline.imageProcessing.contrast = 2.0;
450
+ pipeline.imageProcessing.exposure = 0.5;
451
+
452
+ BABYLON.Engine.LastCreatedScene.activeCamera.fov = document.getElementById("zoom").value;
453
+
454
+ if (!document.getElementById("model3D").getElementsByTagName("canvas")[0].oncontextmenu) {
455
+ document.getElementById("model3D").getElementsByTagName("canvas")[0].style.filter = "blur(" + BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById("fnum").getElementsByTagName("input")[0].value)+1].material.pointSize/2.0*Math.sqrt(2.0) + "px)";
456
+ document.getElementById("model3D").getElementsByTagName("canvas")[0].oncontextmenu = function(e){e.preventDefault();}
457
+ document.getElementById("model3D").getElementsByTagName("canvas")[0].ondrag = function(e){e.preventDefault();}
458
+ }
459
  clearInterval(intv);
460
  }
461
  }, 40);