Update app.py
Browse files
app.py
CHANGED
|
@@ -624,6 +624,7 @@ async(c, o, p, d, n, m)=>{
|
|
| 624 |
|
| 625 |
document.getElementById("model3D").appendChild(document.getElementById("compass_box"));
|
| 626 |
window.coords = JSON.parse(document.getElementById("coords").getElementsByTagName("textarea")[0].value);
|
|
|
|
| 627 |
|
| 628 |
if (o.indexOf(""+n) < 0) {
|
| 629 |
if (o != "") { o += ","; }
|
|
@@ -751,6 +752,8 @@ async(c, o, p, d, n, m)=>{
|
|
| 751 |
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
|
| 752 |
if (buffer) {
|
| 753 |
applyDisplacementMapFromBuffer(sceneToRender.meshes[sceneToRender.meshes.length-1], buffer, video.videoWidth, video.videoHeight, 0, -1, null, null, true);
|
|
|
|
|
|
|
| 754 |
}
|
| 755 |
buffer = ctx.getImageData(0, 0, video.videoWidth, video.videoHeight).data;
|
| 756 |
applyDisplacementMapFromBuffer(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1], buffer, video.videoWidth, video.videoHeight, 0, 1, null, null, true);
|
|
@@ -978,10 +981,10 @@ window.snapshot = snapshot;
|
|
| 978 |
mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions);
|
| 979 |
|
| 980 |
mesh.rotationQuaternion = null;
|
| 981 |
-
mesh.position.z = coords[
|
| 982 |
-
mesh.position.x = coords[
|
| 983 |
-
mesh.rotation.y = coords[
|
| 984 |
-
mesh.rotation.z = coords[
|
| 985 |
|
| 986 |
return mesh;
|
| 987 |
}
|
|
|
|
| 624 |
|
| 625 |
document.getElementById("model3D").appendChild(document.getElementById("compass_box"));
|
| 626 |
window.coords = JSON.parse(document.getElementById("coords").getElementsByTagName("textarea")[0].value);
|
| 627 |
+
window.counter = 0;
|
| 628 |
|
| 629 |
if (o.indexOf(""+n) < 0) {
|
| 630 |
if (o != "") { o += ","; }
|
|
|
|
| 752 |
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
|
| 753 |
if (buffer) {
|
| 754 |
applyDisplacementMapFromBuffer(sceneToRender.meshes[sceneToRender.meshes.length-1], buffer, video.videoWidth, video.videoHeight, 0, -1, null, null, true);
|
| 755 |
+
counter++;
|
| 756 |
+
if (counter == coords.length) {counter = 0;}
|
| 757 |
}
|
| 758 |
buffer = ctx.getImageData(0, 0, video.videoWidth, video.videoHeight).data;
|
| 759 |
applyDisplacementMapFromBuffer(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1], buffer, video.videoWidth, video.videoHeight, 0, 1, null, null, true);
|
|
|
|
| 981 |
mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions);
|
| 982 |
|
| 983 |
mesh.rotationQuaternion = null;
|
| 984 |
+
mesh.position.z = coords[counter].lat;
|
| 985 |
+
mesh.position.x = coords[counter].lng;
|
| 986 |
+
mesh.rotation.y = coords[counter].heading / 180 * Math.PI;
|
| 987 |
+
mesh.rotation.z = coords[counter].pitch / 180 * Math.PI;
|
| 988 |
|
| 989 |
return mesh;
|
| 990 |
}
|