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
2df437f7
Commit
2df437f7
authored
Jul 21, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to real world coordinates
parent
23871976
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
4 deletions
+57
-4
ic_horizon_black_48dp_1x.png
js/images/ic_horizon_black_48dp_1x.png
+0
-0
ic_horizon_black_48dp_2x.png
js/images/ic_horizon_black_48dp_2x.png
+0
-0
ui_align.js
js/ui_align.js
+30
-0
ui_init.js
js/ui_init.js
+7
-4
util_functions.js
js/util_functions.js
+9
-0
x3dom_functions.js
js/x3dom_functions.js
+9
-0
viewer.html
viewer.html
+2
-0
No files found.
js/images/ic_horizon_black_48dp_1x.png
0 → 100644
View file @
2df437f7
738 Bytes
js/images/ic_horizon_black_48dp_2x.png
0 → 100644
View file @
2df437f7
1.87 KB
js/ui_align.js
View file @
2df437f7
...
@@ -48,6 +48,10 @@ function align_init(){
...
@@ -48,6 +48,10 @@ function align_init(){
x3dom_align_GN
();
x3dom_align_GN
();
});
});
$
(
"#align_tr_button"
).
on
(
"click"
,
function
(){
x3dom_align_tr
();
});
/*
/*
$("#align_0").on("click",function(){
$("#align_0").on("click",function(){
x3dom_align_0();
x3dom_align_0();
...
@@ -381,6 +385,32 @@ function distance_error(x,y,h){
...
@@ -381,6 +385,32 @@ function distance_error(x,y,h){
}
}
function
x3dom_align_tr
(){
if
(
Data
.
markers
.
length
<
2
){
console
.
log
(
"Too few points"
);
return
;
}
var
mark0
=
Data
.
markers
[
0
];
var
mark1
=
Data
.
markers
[
1
];
var
v0
=
{
x
:
mark0
.
align
.
x
,
y
:
mark0
.
align
.
y
,
z
:
mark0
.
align
.
z
};
var
v1
=
{
x
:
mark1
.
align
.
x
,
y
:
mark1
.
align
.
y
,
z
:
mark1
.
align
.
z
};
var
dx
=
Math
.
abs
(
v1
.
x
-
v0
.
x
);
var
dy
=
Math
.
abs
(
v1
.
y
-
v0
.
y
);
var
dz
=
Math
.
abs
(
v1
.
z
-
v0
.
z
);
console
.
log
(
dx
+
" "
+
dy
+
" "
+
dz
);
var
tilt
=
180
/
Math
.
PI
*
Math
.
asin
(
dy
/
Math
.
sqrt
(
dy
*
dy
+
dz
*
dz
));
var
roll
=
180
/
Math
.
PI
*
Math
.
asin
(
dy
/
Math
.
sqrt
(
dy
*
dy
+
dx
*
dx
));
console
.
log
(
"Tilt: "
+
tilt
+
" Roll: "
+
roll
);
}
/*
/*
* not used
* not used
*/
*/
...
...
js/ui_init.js
View file @
2df437f7
...
@@ -617,9 +617,12 @@ function leaf_events(){
...
@@ -617,9 +617,12 @@ function leaf_events(){
p_w
=
x3dom_delta_map2scene
(
p1_ll
,
p2_ll
);
p_w
=
x3dom_delta_map2scene
(
p1_ll
,
p2_ll
);
mark
.
x
=
p_w
.
x
;
//conversion to real world coordinates
mark
.
y
=
p_w
.
y
;
var
p_rw
=
xyz_to_real_world
(
p_w
.
x
,
p_w
.
y
,
p_w
.
z
);
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
;
...
@@ -777,7 +780,7 @@ function leaf_drag_marker(){
...
@@ -777,7 +780,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
);
...
...
js/util_functions.js
View file @
2df437f7
...
@@ -78,3 +78,12 @@ function getAzimuth(p1_ll,p2_ll){
...
@@ -78,3 +78,12 @@ function getAzimuth(p1_ll,p2_ll){
return
azimuth
;
return
azimuth
;
}
}
function
xyz_to_real_world
(
x
,
y
,
z
){
var
R0
=
Data
.
camera
.
Matrices
.
R0
;
var
p_w
=
new
x3dom
.
fields
.
SFVec3f
(
x
,
y
,
z
);
var
p_rw
=
R0
.
multMatrixVec
(
p_w
);
return
[
p_rw
.
x
,
p_rw
.
y
,
p_rw
.
z
];
}
js/x3dom_functions.js
View file @
2df437f7
...
@@ -118,6 +118,11 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -118,6 +118,11 @@ 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
);
...
@@ -185,6 +190,10 @@ function x3dom_getCameraPosOr(round){
...
@@ -185,6 +190,10 @@ 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
,
...
...
viewer.html
View file @
2df437f7
...
@@ -75,6 +75,8 @@ Instructions:
...
@@ -75,6 +75,8 @@ Instructions:
3. Move all markers on the map to update their location - drag to position more precisely.
3. Move all markers on the map to update their location - drag to position more precisely.
4. Click this button - the results will appear in a dialog window with "apply"/"cancel"
4. Click this button - the results will appear in a dialog window with "apply"/"cancel"
5. To save the result click upload button (Initial location and heading) in the menu.'
class=
'edit'
></div>
5. To save the result click upload button (Initial location and heading) in the menu.'
class=
'edit'
></div>
<!--<div id='align_tr_button' title='Align tilt and roll' class='edit'></div>-->
<div
id=
'align_tr_button'
title=
'Align tilt and roll'
class=
'experimental'
></div>
</div>
</div>
<div
id=
'info-wrapper'
>
<div
id=
'info-wrapper'
>
<div
id=
'window-info'
></div>
<div
id=
'window-info'
></div>
...
...
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