skinview3d/example_purejs.html

46 lines
1.2 KiB
HTML
Raw Normal View History

2017-09-02 14:39:01 +02:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>skinpreview3d.js example using pure javascript</title>
</head>
<body>
<div id="skin_container"></div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js"></script>
<script type="text/javascript" src="js/skinpreview3d.js"></script>
<script>
2017-09-10 16:37:35 +02:00
let skinViewer = new skinpreview3d.SkinViewer({
2017-09-09 12:21:54 +02:00
domElement: document.getElementById('skin_container'),
slim: true,
width: 600,
height: 600,
skinUrl: 'img/hatsune_miku.png',
2017-09-09 16:47:39 +02:00
capeUrl: 'img/mojang_cape.png',
animation: skinpreview3d.WalkAnimation
2017-09-09 12:21:54 +02:00
});
2017-09-09 13:00:10 +02:00
// change the skin and cape
2017-09-09 12:21:54 +02:00
// skinViewer.skinUrl = 'img/hatsune_miku.png';
// skinViewer.capeUrl = 'img/mojang_cape.png';
2017-09-02 14:39:01 +02:00
2017-09-09 13:00:10 +02:00
// change the width and height
// skinViewer.width = 300;
// skinViewer.height = 400;
2017-09-02 14:39:01 +02:00
// this enables the mouse control feature
2017-09-10 16:37:35 +02:00
let control = new skinpreview3d.SkinControl(skinViewer);
2017-09-02 14:39:01 +02:00
// this makes the animation paused
// skinViewer.animationPaused = true;
// this changes the animation speed
// skinViewer.animationSpeed = 8;
// this disables the 'right click to play/pause' feature
// control.enableAnimationControl = false;
</script>
</body>
</html>