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
80681b78
Commit
80681b78
authored
Aug 22, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tmp changes
parent
312c254f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
align_functions.js
js/align_functions.js
+5
-3
x3dom_functions.js
js/x3dom_functions.js
+18
-0
No files found.
js/align_functions.js
View file @
80681b78
...
...
@@ -52,10 +52,11 @@ function hll_f_3d_i(i,v){
var
base
=
Data
.
camera
;
var
mark
=
Data
.
markers
[
i
];
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
xyz_real
=
x3dom_scene_to_heading
(
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
(
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(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
];
if
(
res
>
180
)
res
=
res
-
360
;
...
...
@@ -195,6 +196,7 @@ function hll_w_i(i,v){
res
=
(
res
>
1
)?
1
:
res
;
return
res
;
}
/**
...
...
js/x3dom_functions.js
View file @
80681b78
...
...
@@ -744,6 +744,24 @@ function x3dom_scene_to_real(x,y,z){
}
/*
* unapply tilt and roll only, keep heading
*/
function
x3dom_scene_to_heading
(
x
,
y
,
z
){
//var R0 = Data.camera.Matrices.R0;
var
R0
=
Data
.
camera
.
Matrices
.
RC_w
.
inverse
();
var
p_w
=
new
x3dom
.
fields
.
SFVec3f
(
x
,
y
,
z
);
var
p_rw
=
R0
.
multMatrixVec
(
p_w
);
return
{
x
:
p_rw
.
x
,
y
:
p_rw
.
y
,
z
:
p_rw
.
z
}
}
function
x3dom_real_to_scene
(
x
,
y
,
z
){
var
R0i
=
Data
.
camera
.
Matrices
.
R0
.
inverse
();
...
...
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