Commit 119e77df authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fixed: y=0 after dragging marker over map

parent bb081a11
......@@ -48,9 +48,13 @@
* heading in degrees from 3D model
*/
function hll_f_3d_i(i,v){
var base = Data.camera;
var mark = Data.markers[i];
var vec = new x3dom.fields.SFVec3f(mark.align.x-base.x,0,mark.align.z-base.z);
var xyz_real = x3dom_scene_to_real(mark.align.x-base.x,mark.align.y-base.y,mark.align.z-base.z);
var vec = new x3dom.fields.SFVec3f(xyz_real.x,xyz_real.y,xyz_real.z);
var res = Math.atan2(vec.x,-vec.z)*180/Math.PI + v[2];
if (res> 180) res = res - 360;
......@@ -177,9 +181,9 @@ function hll_dr_dh_i(i,v){
function hll_w_i(i,v){
var mark = Data.markers[i];
var xi = mark.align.x;
var yi = mark.align.y;
var zi = mark.align.z;
var xi = mark.align.real.x;
var yi = mark.align.real.y;
var zi = mark.align.real.z;
//var arad = 0.0004404;
var D = 100;
......@@ -200,9 +204,9 @@ function hll_w_i(i,v){
function art_f_3d_i(i,v){
var mark = Data.markers[i];
var xi = mark.align.x;
var yi = mark.align.y;
var zi = mark.align.z;
var xi = mark.align.real.x;
var yi = mark.align.real.y;
var zi = mark.align.real.z;
var res = -Math.cos(v[0])*Math.sin(v[1])*xi;
res += Math.cos(v[0])*Math.cos(v[1])*yi;
......@@ -232,9 +236,9 @@ function art_r_i(i,v){
function art_dr_dx_i(i,v){
var mark = Data.markers[i];
var xi = mark.align.x;
var yi = mark.align.y;
var zi = mark.align.z;
var xi = mark.align.real.x;
var yi = mark.align.real.y;
var zi = mark.align.real.z;
var res = Math.sin(v[0])*Math.sin(v[1])*xi;
res += -Math.sin(v[0])*Math.cos(v[1])*yi;
......@@ -247,9 +251,9 @@ function art_dr_dx_i(i,v){
function art_dr_dy_i(i,v){
var mark = Data.markers[i];
var xi = mark.align.x;
var yi = mark.align.y;
var zi = mark.align.z;
var xi = mark.align.real.x;
var yi = mark.align.real.y;
var zi = mark.align.real.z;
var res = -Math.cos(v[0])*Math.cos(v[1])*xi;
res += -Math.cos(v[0])*Math.sin(v[1])*yi;
......@@ -265,9 +269,9 @@ function art_dr_da_i(i,v){
function art_l_i(i){
var mark = Data.markers[i];
var xi = mark.align.x;
var yi = mark.align.y;
var zi = mark.align.z;
var xi = mark.align.real.x;
var yi = mark.align.real.y;
var zi = mark.align.real.z;
return Math.sqrt(Math.pow(xi,2)+Math.pow(yi,2)+Math.pow(zi,2));
......@@ -310,9 +314,9 @@ function art2_dr_da_i(i,v){
function art2_l_i(i){
var mark = Data.markers[i];
var xi = mark.align.x;
var yi = mark.align.y;
var zi = mark.align.z;
var xi = mark.align.real.x;
var yi = mark.align.real.y;
var zi = mark.align.real.z;
return Math.sqrt(Math.pow(xi,2)+Math.pow(yi,2)+Math.pow(zi,2));
......
......@@ -245,7 +245,11 @@ function distance_error(x,y,h){
var angle0 = h;
var angle1 = hll_f_map_i(i,[x,y,h]);
var z_map = Math.cos(Math.PI/180*(angle0-angle1))*Data.markers[i].d_map;
var z_x3d = -Data.markers[i].align.z;
//var z_x3d = -Data.markers[i].align.z;
var z_x3d = x3dom_2d_distance(Data.markers[i].real.align.x,Data.markers[i].real.align.z,round);
sum += 1/z_map-1/z_x3d;
console.log("Marker: "+i+", Camera heading: "+angle0+", Point azimuth: "+angle1+" , z_map: "+z_map+", z_x3d: "+z_x3d+", error^-1: "+(1/z_map-1/z_x3d));
}
......
......@@ -1351,21 +1351,21 @@ X3DOMObject.displayMarkInfo = function(index){
}
msg = [
'<div>Marker '+index+' (Satellite vs 3D model)</div>',
'<table>',
'<tr title=\'drag marker over map to update distance\'>',
' <th align=\'left\'>d<sub>map</sub></th>',
' <td align=\'left\' style=\'text-align:left;\'>'+d_map_msg+'</td>',
'</tr>',
'<tr title=\'drag marker over 3d scene to update distance\'>',
' <th align=\'left\'>d<sub>3d</sub></th>',
' <td align=\'left\' style=\'text-align:left;\'>'+d_x3d_msg+'</td>',
'</tr>',
'<tr>',
' <th align=\'center\'>&Delta;</th>',
' <td align=\'left\' style=\'text-align:left;\'>'+delta+' m</td>',
'</tr>',
'</table>'
'<div>Marker '+index+' (Satellite vs 3D model)</div>',
'<table>',
'<tr title=\'drag marker over map to update distance\'>',
' <th align=\'left\'>d<sub>map</sub></th>',
' <td align=\'left\' style=\'text-align:left;\'>'+d_map_msg+'</td>',
'</tr>',
'<tr title=\'drag marker over 3d scene to update distance\'>',
' <th align=\'left\'>d<sub>3d</sub></th>',
' <td align=\'left\' style=\'text-align:left;\'>'+d_x3d_msg+'</td>',
'</tr>',
'<tr>',
' <th align=\'center\'>&Delta;</th>',
' <td align=\'left\' style=\'text-align:left;\'>'+delta+' m</td>',
'</tr>',
'</table>'
].join('\n');
}
......@@ -1380,8 +1380,6 @@ X3DOMObject.displayMarkInfo = function(index){
X3DOMObject.createNewMarker = function(x,y,z){
console.log("Create marker");
x = parseFloat(x);
y = parseFloat(y);
z = parseFloat(z);
......
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