freealise commited on
Commit
6b84814
·
verified ·
1 Parent(s): dc8f5a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -703,8 +703,8 @@ async(c, o, p, d, n, m, s)=>{
703
  window.ctx = null;
704
  window.video = document.getElementById("depth_video").getElementsByTagName("video")[0];
705
  window.parallax = 0;
706
- window.xdir = new BABYLON.Vector3(-1, -1, -1);
707
- window.rdir = new BABYLON.Vector3(0, 0, 0);
708
 
709
  document.getElementById("model3D").getElementsByTagName("canvas")[0].addEventListener('pointermove', function(evt) {
710
  if (md === true) {
@@ -1291,7 +1291,7 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
1291
 
1292
  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)\";
1293
  '/><span>0.8</span></span><br/>
1294
- <span><label for='pan' style='width:8em'>Pan</label><input id='pan' type='range' style='width:128px;height:1em;' value='0' min='-16' max='16' step='0.001' oninput='
1295
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
1296
  var evt = document.createEvent(\"Event\");
1297
  evt.initEvent(\"click\", true, false);
@@ -1301,6 +1301,7 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
1301
  rdir = BABYLON.Engine.LastCreatedScene.activeCamera.getDirection(xdir);
1302
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].position.x = parallax * rdir.x;
1303
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].position.z = parallax * rdir.z;
 
1304
  this.parentNode.childNodes[2].innerText = parallax;
1305
  '/><span>0.0</span></span><br/>
1306
  <span><label for='contrast' style='width:8em'>Contrast</label><input id='contrast' type='range' style='width:128px;height:1em;' value='1.0' min='0' max='2' step='0.001' oninput='
 
703
  window.ctx = null;
704
  window.video = document.getElementById("depth_video").getElementsByTagName("video")[0];
705
  window.parallax = 0;
706
+ window.xdir = new BABYLON.Vector3(1, 0, 0);
707
+ window.rdir = new BABYLON.Vector3(1, 0, 0);
708
 
709
  document.getElementById("model3D").getElementsByTagName("canvas")[0].addEventListener('pointermove', function(evt) {
710
  if (md === true) {
 
1291
 
1292
  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)\";
1293
  '/><span>0.8</span></span><br/>
1294
+ <span><label for='pan' style='width:8em'>Pan</label><input id='pan' type='range' style='width:128px;height:1em;' value='0' min='-64' max='64' step='0.001' oninput='
1295
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
1296
  var evt = document.createEvent(\"Event\");
1297
  evt.initEvent(\"click\", true, false);
 
1301
  rdir = BABYLON.Engine.LastCreatedScene.activeCamera.getDirection(xdir);
1302
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].position.x = parallax * rdir.x;
1303
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].position.z = parallax * rdir.z;
1304
+ alert(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].position);
1305
  this.parentNode.childNodes[2].innerText = parallax;
1306
  '/><span>0.0</span></span><br/>
1307
  <span><label for='contrast' style='width:8em'>Contrast</label><input id='contrast' type='range' style='width:128px;height:1em;' value='1.0' min='0' max='2' step='0.001' oninput='