Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
ee479019
Commit
ee479019
authored
Aug 09, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed back least square fitting
parent
119e77df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
20 deletions
+26
-20
align_functions.js
js/align_functions.js
+20
-19
ui_align.js
js/ui_align.js
+1
-1
ui_init.js
js/ui_init.js
+5
-0
No files found.
js/align_functions.js
View file @
ee479019
...
@@ -54,7 +54,8 @@ function hll_f_3d_i(i,v){
...
@@ -54,7 +54,8 @@ function hll_f_3d_i(i,v){
var
xyz_real
=
x3dom_scene_to_real
(
mark
.
align
.
x
-
base
.
x
,
mark
.
align
.
y
-
base
.
y
,
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 vec = new x3dom.fields.SFVec3f(xyz_real.x,xyz_real.y,xyz_real.z);
var
vec
=
new
x3dom
.
fields
.
SFVec3f
(
mark
.
align
.
x
-
base
.
x
,
mark
.
align
.
y
-
base
.
y
,
mark
.
align
.
z
-
base
.
z
);
var
res
=
Math
.
atan2
(
vec
.
x
,
-
vec
.
z
)
*
180
/
Math
.
PI
+
v
[
2
];
var
res
=
Math
.
atan2
(
vec
.
x
,
-
vec
.
z
)
*
180
/
Math
.
PI
+
v
[
2
];
if
(
res
>
180
)
res
=
res
-
360
;
if
(
res
>
180
)
res
=
res
-
360
;
...
@@ -181,9 +182,9 @@ function hll_dr_dh_i(i,v){
...
@@ -181,9 +182,9 @@ function hll_dr_dh_i(i,v){
function
hll_w_i
(
i
,
v
){
function
hll_w_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
real
.
x
;
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
real
.
y
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
real
.
z
;
var
zi
=
mark
.
align
.
z
;
//var arad = 0.0004404;
//var arad = 0.0004404;
var
D
=
100
;
var
D
=
100
;
...
@@ -204,9 +205,9 @@ function hll_w_i(i,v){
...
@@ -204,9 +205,9 @@ function hll_w_i(i,v){
function
art_f_3d_i
(
i
,
v
){
function
art_f_3d_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
real
.
x
;
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
real
.
y
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
real
.
z
;
var
zi
=
mark
.
align
.
z
;
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
xi
;
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
xi
;
res
+=
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
res
+=
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
...
@@ -236,9 +237,9 @@ function art_r_i(i,v){
...
@@ -236,9 +237,9 @@ function art_r_i(i,v){
function
art_dr_dx_i
(
i
,
v
){
function
art_dr_dx_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
real
.
x
;
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
real
.
y
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
real
.
z
;
var
zi
=
mark
.
align
.
z
;
var
res
=
Math
.
sin
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
xi
;
var
res
=
Math
.
sin
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
xi
;
res
+=
-
Math
.
sin
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
res
+=
-
Math
.
sin
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
...
@@ -251,9 +252,9 @@ function art_dr_dx_i(i,v){
...
@@ -251,9 +252,9 @@ function art_dr_dx_i(i,v){
function
art_dr_dy_i
(
i
,
v
){
function
art_dr_dy_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
real
.
x
;
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
real
.
y
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
real
.
z
;
var
zi
=
mark
.
align
.
z
;
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
xi
;
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
xi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
yi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
yi
;
...
@@ -269,9 +270,9 @@ function art_dr_da_i(i,v){
...
@@ -269,9 +270,9 @@ function art_dr_da_i(i,v){
function
art_l_i
(
i
){
function
art_l_i
(
i
){
var
mark
=
Data
.
markers
[
i
];
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
real
.
x
;
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
real
.
y
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
real
.
z
;
var
zi
=
mark
.
align
.
z
;
return
Math
.
sqrt
(
Math
.
pow
(
xi
,
2
)
+
Math
.
pow
(
yi
,
2
)
+
Math
.
pow
(
zi
,
2
));
return
Math
.
sqrt
(
Math
.
pow
(
xi
,
2
)
+
Math
.
pow
(
yi
,
2
)
+
Math
.
pow
(
zi
,
2
));
...
@@ -314,9 +315,9 @@ function art2_dr_da_i(i,v){
...
@@ -314,9 +315,9 @@ function art2_dr_da_i(i,v){
function
art2_l_i
(
i
){
function
art2_l_i
(
i
){
var
mark
=
Data
.
markers
[
i
];
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
real
.
x
;
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
real
.
y
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
real
.
z
;
var
zi
=
mark
.
align
.
z
;
return
Math
.
sqrt
(
Math
.
pow
(
xi
,
2
)
+
Math
.
pow
(
yi
,
2
)
+
Math
.
pow
(
zi
,
2
));
return
Math
.
sqrt
(
Math
.
pow
(
xi
,
2
)
+
Math
.
pow
(
yi
,
2
)
+
Math
.
pow
(
zi
,
2
));
...
...
js/ui_align.js
View file @
ee479019
...
@@ -248,7 +248,7 @@ function distance_error(x,y,h){
...
@@ -248,7 +248,7 @@ function distance_error(x,y,h){
//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
);
var
z_x3d
=
x3dom_2d_distance
(
Data
.
markers
[
i
].
align
.
real
.
x
,
Data
.
markers
[
i
].
align
.
real
.
z
,
false
);
sum
+=
1
/
z_map
-
1
/
z_x3d
;
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
));
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
));
...
...
js/ui_init.js
View file @
ee479019
...
@@ -877,6 +877,7 @@ function leaf_drag_marker(){
...
@@ -877,6 +877,7 @@ function leaf_drag_marker(){
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
);
}
}
...
@@ -902,9 +903,13 @@ function leaf_update_x3dom_marker(p1_ll,p2_ll,index){
...
@@ -902,9 +903,13 @@ function leaf_update_x3dom_marker(p1_ll,p2_ll,index){
var
dp_w
=
x3dom_delta_map2scene
(
p1_ll
,
p2_ll
);
var
dp_w
=
x3dom_delta_map2scene
(
p1_ll
,
p2_ll
);
//update distance only
/*
mark.x = dp_w.x;
mark.x = dp_w.x;
mark.y = dp_w.y;
mark.y = dp_w.y;
mark.z = dp_w.z;
mark.z = dp_w.z;
*/
if
(
!
hecs
){
if
(
!
hecs
){
mark
.
d_map
=
distance
;
mark
.
d_map
=
distance
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment