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
63a79179
Commit
63a79179
authored
Sep 29, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui for models alignment
parent
7c5d2701
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
11 deletions
+64
-11
ui_extra_models.js
js/ui_extra_models.js
+54
-3
ui_init.js
js/ui_init.js
+3
-0
x3dom_functions.js
js/x3dom_functions.js
+7
-8
No files found.
js/ui_extra_models.js
View file @
63a79179
...
...
@@ -66,7 +66,9 @@ function manualposor_init(){
' <th align=
\'
left
\'
colspan=
\'
3
\'
>orientation, °</th>'
,
' </tr>'
,
' <tr>'
,
' <th colspan=
\'
4
\'
></th>'
,
' <th colspan=
\'
1
\'
></th>'
,
' <th colspan=
\'
2
\'
><button title=
\'
reset radios (r1 & r2)
\'
id=
\'
mpr_reset_radios
\'
>reset</button></th>'
,
' <th colspan=
\'
1
\'
></th>'
,
' <th class=
\'
mpr_name
\'
>step, m :</th>'
,
' <th class=
\'
mpr_name
\'
><input id=
\'
mpr_step_m
\'
type=
\'
text
\'
class=
\'
mpr_steps
\'
value=
\'
0.001
\'
></th>'
,
' <th></th>'
,
...
...
@@ -154,6 +156,18 @@ function manualposor_init(){
});
});
$
(
"#mpr_reset_radios"
).
on
(
'click'
,
function
(){
$
(
".mpr_r1"
).
each
(
function
(){
$
(
this
).
prop
(
"checked"
,
false
);
});
$
(
".mpr_r2"
).
each
(
function
(){
$
(
this
).
prop
(
"checked"
,
false
);
});
});
}
// Loading
...
...
@@ -369,8 +383,8 @@ function manualposor_refresh_content(){
$
(
"#mpr_table"
).
append
(
$
([
'<tr class=
\'
mpr_content
\'
>'
,
' <td align=
\'
center
\'
class=
\'
mpr_name mpr_modelname
\'
>'
+
name
+
'</td>'
,
' <td><input type=
\'
radio
\'
class=
\'
mpr_r1
\'
name=
\'
r1
\'
></td>'
,
' <td><input type=
\'
radio
\'
class=
\'
mpr_r2
\'
name=
\'
r2
\'
></td>'
,
' <td><input type=
\'
radio
\'
class=
\'
mpr_r1
\'
name=
\'
r1
\'
value=
\'
'
+
name
+
'
\'
id=
\'
r1_'
+
name
+
'
\'
></td>'
,
' <td><input type=
\'
radio
\'
class=
\'
mpr_r2
\'
name=
\'
r2
\'
value=
\'
'
+
name
+
'
\'
id=
\'
r2_'
+
name
+
'
\'
></td>'
,
' <td><input type=
\'
checkbox
\'
class=
\'
mpr_hide
\'
></td>'
,
' <td><input type=
\'
text
\'
class=
\'
mpr_input mpr_tra mpr_x
\'
value=
\'
'
+
tra_tra_rw
.
x
.
toFixed
(
3
)
+
'
\'
\
></td>'
,
' <td><input type=
\'
text
\'
class=
\'
mpr_input mpr_tra mpr_y
\'
value=
\'
'
+
tra_tra_rw
.
y
.
toFixed
(
3
)
+
'
\'
\
></td>'
,
...
...
@@ -383,6 +397,11 @@ function manualposor_refresh_content(){
});
// rebind all
$
(
".mpr_r1[name=r1]"
).
off
(
'change'
).
change
(
function
(){
console
.
log
(
"Go "
+
this
.
value
);
});
// remove entry if inline missing
$
(
".mpr_modelname"
).
each
(
function
(){
...
...
@@ -522,4 +541,36 @@ function manualposor_update(elem){
}
function
manualposor_rotate_glued
(){
$
(
".mpr_r1[name=r1]:checked"
).
each
(
function
(){
var
modelname
=
$
(
this
).
val
();
var
tmptransform
=
$
(
"inline[name=x3d_"
+
modelname
+
"]"
).
parent
().
parent
();
var
vm
=
Scene
.
element
.
runtime
.
viewMatrix
().
inverse
();
});
}
js/ui_init.js
View file @
63a79179
...
...
@@ -427,6 +427,9 @@ function deep_init(){
//x3dom_testbox();
x3dom_setUpRight
();
if
(
SETTINGS
.
manualposor
){
manualposor_rotate_glued
();
}
}
...
...
js/x3dom_functions.js
View file @
63a79179
...
...
@@ -841,13 +841,13 @@ function x3dom_update_map(){
}
function
x3dom_testbox
(){
// keep the test cube
var
mat
=
Scene
.
element
.
runtime
.
viewMatrix
().
inverse
();
var
Q
=
new
x3dom
.
fields
.
Quaternion
(
0
,
0
,
1
,
0
);
Q
.
setValue
(
mat
);
var
AA
=
Q
.
toAxisAngle
();
var
testbox
=
$
(
"#testbox"
);
testbox
.
attr
(
"rotation"
,
AA
[
0
].
toString
()
+
" "
+
AA
[
1
]);
// keep the test cube
var
mat
=
Scene
.
element
.
runtime
.
viewMatrix
().
inverse
();
var
Q
=
new
x3dom
.
fields
.
Quaternion
(
0
,
0
,
1
,
0
);
Q
.
setValue
(
mat
);
var
AA
=
Q
.
toAxisAngle
();
var
testbox
=
$
(
"#testbox"
);
testbox
.
attr
(
"rotation"
,
AA
[
0
].
toString
()
+
" "
+
AA
[
1
]);
}
// uses globals
...
...
@@ -872,4 +872,3 @@ function x3dom_setViewpoint(m){
Data
.
camera
.
Matrices
.
RC_w
=
m
;
}
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