Commit 8fd01e93 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

display real world coordinates

parent 2df437f7
...@@ -617,12 +617,9 @@ function leaf_events(){ ...@@ -617,12 +617,9 @@ function leaf_events(){
p_w = x3dom_delta_map2scene(p1_ll,p2_ll); p_w = x3dom_delta_map2scene(p1_ll,p2_ll);
//conversion to real world coordinates mark.x = p_w.x;
var p_rw = xyz_to_real_world(p_w.x,p_w.y,p_w.z); mark.y = p_w.y;
mark.z = p_w.z;
mark.x = p_rw.x;
mark.y = p_rw.y;
mark.z = p_rw.z;
mark.d_map = distance; mark.d_map = distance;
...@@ -780,7 +777,7 @@ function leaf_drag_marker(){ ...@@ -780,7 +777,7 @@ function leaf_drag_marker(){
var index = Camera.draggedMarker._index; var index = Camera.draggedMarker._index;
var p1_ll = Camera._latlng; var p1_ll = Camera._latlng;
var p2_ll = Camera.draggedMarker.__latlng; var p2_ll = Camera.draggedMarker._latlng;
leaf_update_x3dom_marker(p1_ll,p2_ll,index); leaf_update_x3dom_marker(p1_ll,p2_ll,index);
X3DOMObject.displayMarkInfo(index); X3DOMObject.displayMarkInfo(index);
......
...@@ -85,5 +85,5 @@ function xyz_to_real_world(x,y,z){ ...@@ -85,5 +85,5 @@ function xyz_to_real_world(x,y,z){
var p_w = new x3dom.fields.SFVec3f(x,y,z); var p_w = new x3dom.fields.SFVec3f(x,y,z);
var p_rw = R0.multMatrixVec(p_w); var p_rw = R0.multMatrixVec(p_w);
return [p_rw.x,p_rw.y,p_rw.z]; return {x: p_rw.x, y: p_rw.y, z: p_rw.z};
} }
...@@ -118,11 +118,6 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){ ...@@ -118,11 +118,6 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
var p_w = new x3dom.fields.SFVec3f(x,y,z); var p_w = new x3dom.fields.SFVec3f(x,y,z);
var p_rw = R0.multMatrixVec(p_w); var p_rw = R0.multMatrixVec(p_w);
//conversion to real world coordinates
x = p_rw.x;
y = p_rw.y;
z = p_rw.z;
if (valid_distance){ if (valid_distance){
dist_xz = Math.sqrt(p_rw.x*p_rw.x+p_rw.z*p_rw.z); dist_xz = Math.sqrt(p_rw.x*p_rw.x+p_rw.z*p_rw.z);
dist_xyz = Math.sqrt(p_rw.y*p_rw.y+dist_xz*dist_xz); dist_xyz = Math.sqrt(p_rw.y*p_rw.y+dist_xz*dist_xz);
...@@ -190,10 +185,6 @@ function x3dom_getCameraPosOr(round){ ...@@ -190,10 +185,6 @@ function x3dom_getCameraPosOr(round){
//x3dom_matrix_test(); //x3dom_matrix_test();
//conversion to real world coordinates
var tmp = xyz_to_real_world(tr.x,tr.y,tr.z);
tr = new x3dom.fields.SFVec3f(tmp[0],tmp[1],tmp[2]);
if (!round){ if (!round){
return { return {
x: tr.x, x: tr.x,
......
...@@ -1241,6 +1241,19 @@ X3DOMObject.displayViewInfo = function(e){ ...@@ -1241,6 +1241,19 @@ X3DOMObject.displayViewInfo = function(e){
var camera = x3dom_getCameraPosOr(true); var camera = x3dom_getCameraPosOr(true);
//convert to real world coordinates
var tmp = xyz_to_real_world(mouse.x,mouse.y,mouse.z);
mouse.x = tmp.x.toFixed(2);
mouse.y = tmp.y.toFixed(2);
mouse.z = tmp.z.toFixed(2);
//convert to real world coordinates
var tmp = xyz_to_real_world(camera.x,camera.y,camera.z);
camera.x = tmp.x.toFixed(2);
camera.y = tmp.y.toFixed(2);
camera.z = tmp.z.toFixed(2);
// ?!!! // ?!!!
//Map.marker.setAltitude(camera.y); //Map.marker.setAltitude(camera.y);
//Map.marker.setElevation(camera.e*Math.PI/180); //Map.marker.setElevation(camera.e*Math.PI/180);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment