Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
freecad_x3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
freecad_x3d
Commits
48c3c6fa
Commit
48c3c6fa
authored
Dec 19, 2015
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restart animation
parent
c56784f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
viewmodel.js
x3d_web_viewer/viewmodel.js
+14
-2
No files found.
x3d_web_viewer/viewmodel.js
View file @
48c3c6fa
...
@@ -83,7 +83,7 @@ function prerun(){
...
@@ -83,7 +83,7 @@ function prerun(){
//onLoad:"document.getElementById('x3d_canvas').runtime.showAll()"
//onLoad:"document.getElementById('x3d_canvas').runtime.showAll()"
});
});
var
x3d_cnv_trans
=
$
(
"<Transform DEF='ball'>"
);
var
x3d_cnv_trans
=
$
(
"<Transform
id='anima'
DEF='ball'>"
);
var
x3d_cnv_anim
=
$
(
"
\
var
x3d_cnv_anim
=
$
(
"
\
<timeSensor DEF='time' cycleInterval='50' loop='true'></timeSensor>
\
<timeSensor DEF='time' cycleInterval='50' loop='true'></timeSensor>
\
...
@@ -270,6 +270,8 @@ function prerun(){
...
@@ -270,6 +270,8 @@ function prerun(){
model_init
();
model_init
();
element
.
runtime
.
showAll
(
"negY"
);
element
.
runtime
.
showAll
(
"negY"
);
if
(
showdefault
)
element
.
runtime
.
resetView
();
if
(
showdefault
)
element
.
runtime
.
resetView
();
element
.
runtime
.
resetView
();
if
(
animate
)
start_animation
();
});
});
$
(
"#main"
).
append
(
rst_model
);
$
(
"#main"
).
append
(
rst_model
);
...
@@ -411,7 +413,7 @@ function place_camera(){
...
@@ -411,7 +413,7 @@ function place_camera(){
if
(
showdefault
)
element
.
runtime
.
resetView
();
if
(
showdefault
)
element
.
runtime
.
resetView
();
var
x3d_cnv_ni
=
$
(
"NavigationInfo"
);
var
x3d_cnv_ni
=
$
(
"NavigationInfo"
);
x3d_cnv_ni
.
prop
(
"speed"
,
Math
.
round
(
Math
.
sqrt
(
view_distance
)
/
10
));
x3d_cnv_ni
.
prop
(
"speed"
,
Math
.
round
(
Math
.
sqrt
(
view_distance
)
/
5
));
console
.
log
(
"speed is "
+
x3d_cnv_ni
.
prop
(
"speed"
));
console
.
log
(
"speed is "
+
x3d_cnv_ni
.
prop
(
"speed"
));
}
}
...
@@ -628,10 +630,20 @@ function touchmoved(){
...
@@ -628,10 +630,20 @@ function touchmoved(){
function
stop_animation
(){
function
stop_animation
(){
$
(
"timeSensor"
).
remove
();
$
(
"timeSensor"
).
remove
();
$
(
"orientationInterpolator"
).
remove
();
$
(
"Route"
).
remove
();
}
}
function
start_animation
(){
function
start_animation
(){
console
.
log
(
"restart animation"
);
var
x3d_cnv_anim
=
$
(
"
\
<timeSensor DEF='time' cycleInterval='50' loop='true'></timeSensor>
\
<orientationInterpolator DEF='move' key='0 0.5 1' keyValue='0 0 1 0 0 0 1 3.14159 0 0 1 6.28317'></orientationInterpolator>
\
<Route fromNode='time' fromField ='fraction_changed' toNode='move' toField='set_fraction'></Route>
\
<Route fromNode='move' fromField ='value_changed' toNode='ball' toField='set_rotation'></Route>
\
"
);
$
(
"#anima"
).
append
(
x3d_cnv_anim
);
}
}
function
getTimeStamp
(){
function
getTimeStamp
(){
...
...
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