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
119e77df
Commit
119e77df
authored
Aug 09, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed: y=0 after dragging marker over map
parent
bb081a11
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
37 deletions
+43
-37
align_functions.js
js/align_functions.js
+23
-19
ui_align.js
js/ui_align.js
+5
-1
x3dom_init.js
js/x3dom_init.js
+15
-17
No files found.
js/align_functions.js
View file @
119e77df
...
...
@@ -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
));
...
...
js/ui_align.js
View file @
119e77df
...
...
@@ -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
));
}
...
...
js/x3dom_init.js
View file @
119e77df
...
...
@@ -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
);
...
...
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