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
b85c5312
Commit
b85c5312
authored
Aug 09, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
printing distances to console
parent
ee479019
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
5 deletions
+50
-5
x3dom_functions.js
js/x3dom_functions.js
+49
-4
x3dom_init.js
js/x3dom_init.js
+1
-1
No files found.
js/x3dom_functions.js
View file @
b85c5312
...
...
@@ -158,11 +158,56 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
//distance to previous marker
if
(
(
index
!=
null
)
&&
(
index
>
0
)
&&
(
Data
.
markers
[
index
]
!=
undefined
)
&&
(
Data
.
markers
[
index
-
1
]
!=
undefined
)
(
index
>
=
0
)
&&
(
Data
.
markers
.
length
>
1
)
&&
(
Data
.
markers
[
index
]
!=
undefined
)
){
console
.
log
(
"Getting distance to previous point"
);
var
index1
=
index
;
var
index2
=
index
-
1
;
if
(
index1
==
0
){
index2
=
Data
.
markers
.
length
-
1
;
}
// vars
var
x1r
=
Data
.
markers
[
index1
].
align
.
real
.
x
;
var
y1r
=
Data
.
markers
[
index1
].
align
.
real
.
y
;
var
z1r
=
Data
.
markers
[
index1
].
align
.
real
.
z
;
var
x1
=
Data
.
markers
[
index1
].
align
.
x
;
var
y1
=
Data
.
markers
[
index1
].
align
.
y
;
var
z1
=
Data
.
markers
[
index1
].
align
.
z
;
var
x2r
=
Data
.
markers
[
index2
].
align
.
real
.
x
;
var
y2r
=
Data
.
markers
[
index2
].
align
.
real
.
y
;
var
z2r
=
Data
.
markers
[
index2
].
align
.
real
.
z
;
var
x2
=
Data
.
markers
[
index2
].
align
.
x
;
var
y2
=
Data
.
markers
[
index2
].
align
.
y
;
var
z2
=
Data
.
markers
[
index2
].
align
.
z
;
var
p1_ll
=
new
L
.
LatLng
(
Data
.
markers
[
index1
].
latitude
,
Data
.
markers
[
index1
].
longitude
);
var
p2_ll
=
new
L
.
LatLng
(
Data
.
markers
[
index2
].
latitude
,
Data
.
markers
[
index2
].
longitude
);
//calcs
var
d_3d_r_3
=
x3dom_3d_distance
(
x2r
-
x1r
,
y2r
-
y1r
,
z2r
-
z1r
,
true
);
var
d_3d_r_2
=
x3dom_2d_distance
(
x2r
-
x1r
,
z2r
-
z1r
,
true
);
var
d_3d_3
=
x3dom_3d_distance
(
x2
-
x1
,
y2
-
y1
,
z2
-
z1
,
true
);
var
d_3d_2
=
x3dom_2d_distance
(
x2
-
x1
,
z2
-
z1
,
true
);
var
d_map
=
p1_ll
.
distanceTo
(
p2_ll
).
toFixed
(
2
);
var
log
=
[
'Distances from marker '
+
index1
+
' to (previous) marker '
+
(
index2
),
'scene: d_xyz = '
+
d_3d_r_3
+
' d_xz = '
+
d_3d_r_2
,
'world: d_xyz = '
+
d_3d_3
+
' d_xz = '
+
d_3d_2
,
'map : d_xz = '
+
d_map
].
join
(
'
\
n'
);
console
.
log
(
log
);
}
// fill out the output
...
...
js/x3dom_init.js
View file @
b85c5312
...
...
@@ -1264,7 +1264,7 @@ X3DOMObject.displayViewInfo = function(e){
' world : x='
+
mouse
.
real
.
x
+
' y='
+
mouse
.
real
.
y
+
' z='
+
mouse
.
real
.
z
+
' d_xz='
+
m_real_dxz
+
' d_xyz='
+
m_real_dxyz
].
join
(
'
\
n'
);
console
.
log
(
log
);
//
console.log(log);
var
msg
=
[
'<table>'
,
...
...
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