freealise commited on
Commit
90cad07
1 Parent(s): 9f2ae6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -353,18 +353,16 @@ with gr.Blocks(css=css) as demo:
353
  }
354
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.samples = 4;
355
  document.getElementsByClassName(\"model3D\")[0].getElementsByTagName(\"canvas\")[0].onfocus = function() {
356
- BABYLON.Engine.LastCreatedScene.getNodes()[1].position.z = 0;
357
- BABYLON.Engine.LastCreatedScene.getNodes()[1].position.y = 0;
358
- BABYLON.Engine.LastCreatedScene.getNodes()[1].position.x = 0;
359
  }
360
  try {
361
  BABYLON.Engine.LastCreatedScene.activeCamera.radius = 255;
362
  var tg = new BABYLON.Vector3(BABYLON.Engine.LastCreatedScene.activeCamera.position.x, BABYLON.Engine.LastCreatedScene.activeCamera.position.y, BABYLON.Engine.LastCreatedScene.activeCamera.position.z);
363
  BABYLON.Engine.LastCreatedScene.activeCamera.radius = 0;
364
 
365
- BABYLON.Engine.LastCreatedScene.activeCamera.setTarget(tg);
366
- BABYLON.Engine.LastCreatedScene.activeCamera.alpha = this.value * Math.PI/16;
367
- BABYLON.Engine.LastCreatedScene.getNodes()[1].rotation.y = BABYLON.Engine.LastCreatedScene.activeCamera.alpha
368
  this.parentNode.childNodes[2].innerText = this.value;
369
  } catch(e) {alert(e);}
370
  '/><span>0.0</span>""")
@@ -407,7 +405,7 @@ with gr.Blocks(css=css) as demo:
407
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.screenshot = false;
408
  try {
409
  BABYLON.Tools.CreateScreenshotUsingRenderTarget(BABYLON.Engine.LastCreatedScene.getEngine(), BABYLON.Engine.LastCreatedScene.activeCamera,
410
- { width: document.getElementsByTagName(\"video\")[0].width }, (durl) => {
411
  document.getElementById(\"img_out\").onload = function() {
412
  var svgd = `<svg id=\"svg_out\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">
413
  <defs>
 
353
  }
354
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.pipeline.samples = 4;
355
  document.getElementsByClassName(\"model3D\")[0].getElementsByTagName(\"canvas\")[0].onfocus = function() {
356
+ BABYLON.Engine.LastCreatedScene.getNodes()[1].setPivotPoint(BABYLON.Engine.LastCreatedScene.activeCamera.position);
357
+ BABYLON.Engine.LastCreatedScene.getNodes()[1].rotation.y = 0;
 
358
  }
359
  try {
360
  BABYLON.Engine.LastCreatedScene.activeCamera.radius = 255;
361
  var tg = new BABYLON.Vector3(BABYLON.Engine.LastCreatedScene.activeCamera.position.x, BABYLON.Engine.LastCreatedScene.activeCamera.position.y, BABYLON.Engine.LastCreatedScene.activeCamera.position.z);
362
  BABYLON.Engine.LastCreatedScene.activeCamera.radius = 0;
363
 
364
+ BABYLON.Engine.LastCreatedScene.getNodes()[1].setPivotPoint(tg);
365
+ BABYLON.Engine.LastCreatedScene.getNodes()[1].rotation.y = this.value * Math.PI/16;
 
366
  this.parentNode.childNodes[2].innerText = this.value;
367
  } catch(e) {alert(e);}
368
  '/><span>0.0</span>""")
 
405
  BABYLON.Engine.LastCreatedScene.activeCamera.metadata.screenshot = false;
406
  try {
407
  BABYLON.Tools.CreateScreenshotUsingRenderTarget(BABYLON.Engine.LastCreatedScene.getEngine(), BABYLON.Engine.LastCreatedScene.activeCamera,
408
+ { width: 1024 }, (durl) => {
409
  document.getElementById(\"img_out\").onload = function() {
410
  var svgd = `<svg id=\"svg_out\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">
411
  <defs>