update
This commit is contained in:
parent
a28adef802
commit
8378e72b34
|
|
@ -127,8 +127,8 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/95/three.min.js"></script>
|
<script type="text/javascript" src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
|
||||||
<script type="text/javascript" src="js/dist/skinview3d.min.js"></script>
|
<script type="text/javascript" src="js/dist/skinview3d.js"></script>
|
||||||
<script type="text/javascript" src="js/example.js"></script>
|
<script type="text/javascript" src="js/example.js"></script>
|
||||||
<script>
|
<script>
|
||||||
initSkinViewer();
|
initSkinViewer();
|
||||||
|
|
@ -136,4 +136,4 @@
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ function initSkinViewer() {
|
||||||
});
|
});
|
||||||
|
|
||||||
skinViewer.camera.position.z = 70;
|
skinViewer.camera.position.z = 70;
|
||||||
skinViewer.animation = new skinview3d.CompositeAnimation();
|
|
||||||
|
|
||||||
control = skinview3d.createOrbitControls(skinViewer);
|
control = skinview3d.createOrbitControls(skinViewer);
|
||||||
|
|
||||||
|
|
@ -73,7 +72,7 @@ function resizeSkinViewer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function pause() {
|
function pause() {
|
||||||
skinViewer.animationPaused = !skinViewer.animationPaused;
|
skinViewer.animations.paused = !skinViewer.animations.paused;
|
||||||
}
|
}
|
||||||
|
|
||||||
function walk() {
|
function walk() {
|
||||||
|
|
@ -82,8 +81,7 @@ function walk() {
|
||||||
delete handles.run;
|
delete handles.run;
|
||||||
}
|
}
|
||||||
|
|
||||||
handles.walk = handles.walk || skinViewer.animation.add(skinview3d.WalkingAnimation);
|
handles.walk = handles.walk || skinViewer.animations.add(skinview3d.WalkingAnimation);
|
||||||
handles.walk.speed = globalAnimationSpeed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function run() {
|
function run() {
|
||||||
|
|
@ -92,16 +90,14 @@ function run() {
|
||||||
delete handles.walk;
|
delete handles.walk;
|
||||||
}
|
}
|
||||||
|
|
||||||
handles.run = handles.run || skinViewer.animation.add(skinview3d.RunningAnimation);
|
handles.run = handles.run || skinViewer.animations.add(skinview3d.RunningAnimation);
|
||||||
handles.run.speed = globalAnimationSpeed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function rotate() {
|
function rotate() {
|
||||||
if (handles.rotate) {
|
if (handles.rotate) {
|
||||||
handles.rotate.paused = !handles.rotate.paused;
|
handles.rotate.paused = !handles.rotate.paused;
|
||||||
} else {
|
} else {
|
||||||
handles.rotate = skinViewer.animation.add(skinview3d.RotatingAnimation);
|
handles.rotate = skinViewer.animations.add(skinview3d.RotatingAnimation);
|
||||||
handles.rotate.speed = globalAnimationSpeed;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,10 +109,6 @@ function setGlobalAnimationSpeed() {
|
||||||
var currentSpeed = el('speed').value;
|
var currentSpeed = el('speed').value;
|
||||||
|
|
||||||
if (!isNaN(currentSpeed)) {
|
if (!isNaN(currentSpeed)) {
|
||||||
globalAnimationSpeed = currentSpeed;
|
skinViewer.animations.speed = currentSpeed;
|
||||||
|
|
||||||
for (var key in handles) {
|
|
||||||
handles[key].speed = currentSpeed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue