skinview3d/example_purejs.html

45 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-09 12:21:54 +02:00
var 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'
});
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
var 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>