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
00cb5a2a
Commit
00cb5a2a
authored
Jun 07, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d_map vs d_3d for markers
parent
d77d8c25
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
282 additions
and
28 deletions
+282
-28
index.css
js/index.css
+14
-0
ui_init.js
js/ui_init.js
+18
-7
x3dom_functions.js
js/x3dom_functions.js
+9
-8
x3dom_init.js
js/x3dom_init.js
+239
-12
test.html
test.html
+2
-1
No files found.
js/index.css
View file @
00cb5a2a
...
@@ -240,6 +240,20 @@ html, body, #x3d_wrapper {
...
@@ -240,6 +240,20 @@ html, body, #x3d_wrapper {
text-align
:
center
;
text-align
:
center
;
}
}
#window-markinfo
{
z-index
:
10
;
background
:
rgba
(
256
,
256
,
256
,
1
);
border
:
0px
solid
rgba
(
100
,
100
,
100
,
0.5
);
border-radius
:
1px
;
color
:
black
;
font-size
:
16px
;
margin-top
:
2px
;
}
#window-markinfo
td
{
text-align
:
center
;
}
.input
{
.input
{
text-align
:
right
;
text-align
:
right
;
width
:
100px
;
width
:
100px
;
...
...
js/ui_init.js
View file @
00cb5a2a
...
@@ -16,7 +16,7 @@ var SETTINGS = {
...
@@ -16,7 +16,7 @@ var SETTINGS = {
'moreinfo'
:
true
,
'moreinfo'
:
true
,
'crosshair'
:
false
,
'crosshair'
:
false
,
'shiftspeed'
:
0.01
,
'shiftspeed'
:
0.01
,
'
verticaldrag'
:
fals
e
'
slidingdrag'
:
tru
e
}
}
$
(
function
(){
$
(
function
(){
...
@@ -408,9 +408,15 @@ function leaf_events(){
...
@@ -408,9 +408,15 @@ function leaf_events(){
mark
.
y
=
0
;
mark
.
y
=
0
;
mark
.
z
=
-
distance
*
Math
.
cos
(
Math
.
PI
/
180
*
angle
);
mark
.
z
=
-
distance
*
Math
.
cos
(
Math
.
PI
/
180
*
angle
);
mark
.
d_map
=
distance
;
mark
.
d_x3d
=
"<font style='color:red;'>drag over 3D</font>"
;
Data
.
markers
.
push
(
mark
);
Data
.
markers
.
push
(
mark
);
new
X3DOMObject
.
Marker
(
mark
.
x
,
mark
.
y
,
mark
.
z
);
X3DOMObject
.
displayMarkInfo
(
Data
.
markers
.
length
-
1
);
//new X3DOMObject.Marker(mark.x,mark.y,mark.z,true);
new
X3DOMObject
.
Marker
(
mark
.
x
,
mark
.
y
,
mark
.
z
,
false
);
//Scene.createMarker(mark.x,mark.y,mark.z);
//Scene.createMarker(mark.x,mark.y,mark.z);
//x3d_markerEvents(Data.markers.length-1);
//x3d_markerEvents(Data.markers.length-1);
...
@@ -532,6 +538,10 @@ function leaf_drag_marker(){
...
@@ -532,6 +538,10 @@ function leaf_drag_marker(){
mark
.
x
=
distance
*
Math
.
sin
(
Math
.
PI
/
180
*
angle
);
mark
.
x
=
distance
*
Math
.
sin
(
Math
.
PI
/
180
*
angle
);
mark
.
z
=
-
distance
*
Math
.
cos
(
Math
.
PI
/
180
*
angle
);
mark
.
z
=
-
distance
*
Math
.
cos
(
Math
.
PI
/
180
*
angle
);
mark
.
d_map
=
distance
;
X3DOMObject
.
displayMarkInfo
(
index
);
X3DOMObject
.
Marker
.
place
(
mark
.
x
,
mark
.
y
,
mark
.
z
,
"my-sph-"
+
index
);
X3DOMObject
.
Marker
.
place
(
mark
.
x
,
mark
.
y
,
mark
.
z
,
"my-sph-"
+
index
);
}
}
...
@@ -665,6 +675,7 @@ function parseURL(){
...
@@ -665,6 +675,7 @@ function parseURL(){
case
"viewinfo"
:
SETTINGS
.
viewinfo
=
true
;
break
;
case
"viewinfo"
:
SETTINGS
.
viewinfo
=
true
;
break
;
case
"moreinfo"
:
SETTINGS
.
moreinfo
=
true
;
break
;
case
"moreinfo"
:
SETTINGS
.
moreinfo
=
true
;
break
;
case
"crosshair"
:
SETTINGS
.
crosshair
=
true
;
break
;
case
"crosshair"
:
SETTINGS
.
crosshair
=
true
;
break
;
case
"slidingdrag"
:
SETTINGS
.
slidingdrag
=
true
;
break
;
case
"shiftspeed"
:
SETTINGS
.
shiftspeed
=
parseFloat
(
parameters
[
i
][
1
]);
break
;
case
"shiftspeed"
:
SETTINGS
.
shiftspeed
=
parseFloat
(
parameters
[
i
][
1
]);
break
;
}
}
}
}
...
...
js/x3dom_functions.js
View file @
00cb5a2a
...
@@ -52,22 +52,22 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -52,22 +52,22 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
y
=
shootRay
.
pickPosition
.
y
;
y
=
shootRay
.
pickPosition
.
y
;
z
=
shootRay
.
pickPosition
.
z
;
z
=
shootRay
.
pickPosition
.
z
;
dist_xz
=
Math
.
sqrt
(
x
*
x
+
z
*
z
);
}
else
{
}
else
{
x
=
Data
.
markers
[
index
].
x
;
x
=
Data
.
markers
[
index
].
x
;
y
=
Data
.
markers
[
index
].
y
;
y
=
Data
.
markers
[
index
].
y
;
z
=
Data
.
markers
[
index
].
z
;
z
=
Data
.
markers
[
index
].
z
;
dist_xz
=
Data
.
markers
[
index
].
d_x3d
;
if
(
isNaN
(
dist_xz
)){
dist_xz
=
Math
.
sqrt
(
x
*
x
+
z
*
z
);
}
}
}
dist_xz
=
Math
.
sqrt
(
x
*
x
+
z
*
z
);
dist_xyz
=
Math
.
sqrt
(
y
*
y
+
dist_xz
*
dist_xz
);
dist_xyz
=
Math
.
sqrt
(
y
*
y
+
dist_xz
*
dist_xz
);
if
(
round
){
dist_xz
.
toFixed
(
2
);
dist_xyz
.
toFixed
(
2
);
}
id
=
$
(
shootRay
.
pickObject
).
attr
(
"id"
);
id
=
$
(
shootRay
.
pickObject
).
attr
(
"id"
);
}
else
{
}
else
{
...
@@ -106,6 +106,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -106,6 +106,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
}
}
result
.
id
=
id
;
result
.
id
=
id
;
result
.
index
=
index
;
return
result
;
return
result
;
...
@@ -336,7 +337,7 @@ function x3dom_matrix_test(){
...
@@ -336,7 +337,7 @@ function x3dom_matrix_test(){
/**
/**
* Get World to Camera coordinates tranform matrix
* Get World to Camera coordinates tranform matrix
* what's
native getWCtoCCMatrix()
?
* what's
x3dom's native getWCtoCCMatrix()? canvas-to-world
?
*/
*/
function
x3dom_W2C
(){
function
x3dom_W2C
(){
return
new
x3dom
.
fields
.
SFMatrix4f
(
return
new
x3dom
.
fields
.
SFMatrix4f
(
...
...
js/x3dom_init.js
View file @
00cb5a2a
This diff is collapsed.
Click to expand it.
test.html
View file @
00cb5a2a
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<navigationInfo
id=
"navInfo"
type=
'"examine"'
speed=
'0.01'
></navigationInfo>
<navigationInfo
id=
"navInfo"
type=
'"examine"'
speed=
'0.01'
></navigationInfo>
<Viewpoint
fieldOfView=
'1'
position=
'0 0 0'
orientation=
'0 0 1 0'
></Viewpoint>
<Viewpoint
fieldOfView=
'1'
position=
'0 0 0'
orientation=
'0 0 1 0'
></Viewpoint>
<group>
<group>
<inline
name=
"
1487451413_967079"
namespacename=
"1487451413_967079
"
url=
"x3d/1487451413_967079.x3d"
/>
<inline
name=
"
mymodel"
namespacename=
"mymodel
"
url=
"x3d/1487451413_967079.x3d"
/>
</group>
</group>
<group>
<group>
<inline
name=
"back"
namespacename=
"back"
url=
"x3d/background.x3d"
/>
<inline
name=
"back"
namespacename=
"back"
url=
"x3d/background.x3d"
/>
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
</div>
</div>
<div
id=
'info-wrapper'
>
<div
id=
'info-wrapper'
>
<div
id=
'window-info'
></div>
<div
id=
'window-info'
></div>
<div
id=
'window-markinfo'
></div>
<div
id=
'window-viewinfo'
></div>
<div
id=
'window-viewinfo'
></div>
</div>
</div>
<div
id=
'menu-content'
>
<div
id=
'menu-content'
>
...
...
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