skinview3d/example_purejs.html

46 lines
1.2 KiB
HTML

<!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>
let skinViewer = new skinpreview3d.SkinViewer({
domElement: document.getElementById("skin_container"),
slim: true,
width: 600,
height: 600,
skinUrl: "img/hatsune_miku.png",
capeUrl: "img/mojang_cape.png",
animation: skinpreview3d.WalkAnimation
});
// change the skin and cape
// skinViewer.skinUrl = "img/hatsune_miku.png";
// skinViewer.capeUrl = "img/mojang_cape.png";
// change the width and height
// skinViewer.width = 300;
// skinViewer.height = 400;
// this enables the mouse control feature
let control = new skinpreview3d.SkinControl(skinViewer);
// 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>