2017-10-01 14:17:34 +02:00
|
|
|
skinview3d
|
|
|
|
========
|
|
|
|
|
2018-06-30 17:32:08 +02:00
|
|
|
[](https://travis-ci.org/bs-community/skinview3d)
|
2018-01-06 13:18:04 +01:00
|
|
|
[](https://www.npmjs.com/package/skinview3d)
|
2018-06-30 17:32:08 +02:00
|
|
|
[](https://github.com/bs-community/skinview3d/blob/master/LICENSE)
|
2018-02-06 16:29:46 +01:00
|
|
|
[](https://gitter.im/skinview3d/Lobby)
|
2017-10-01 14:17:34 +02:00
|
|
|
|
2017-10-01 09:47:40 +02:00
|
|
|
Three.js powered Minecraft skin viewer.
|
2015-09-29 19:12:29 +02:00
|
|
|
|
2016-01-10 18:28:54 +01:00
|
|
|
# Features
|
|
|
|
* 1.8 Skins
|
2017-09-02 14:39:01 +02:00
|
|
|
* HD Skins
|
2016-01-10 18:28:54 +01:00
|
|
|
* Capes
|
2018-07-05 16:17:36 +02:00
|
|
|
* Slim Arms
|
|
|
|
* Automatic model detection (Slim / Default)
|
2016-01-10 18:28:54 +01:00
|
|
|
|
2017-10-01 14:17:34 +02:00
|
|
|
# Usage
|
2018-06-30 17:32:08 +02:00
|
|
|
[Examples of using the viewer](https://bs-community.github.io/skinview3d/)
|
2017-10-01 14:17:34 +02:00
|
|
|
```html
|
|
|
|
<div id="skin_container"></div>
|
|
|
|
<script>
|
|
|
|
let skinViewer = new skinview3d.SkinViewer({
|
|
|
|
domElement: document.getElementById("skin_container"),
|
|
|
|
width: 600,
|
|
|
|
height: 600,
|
|
|
|
skinUrl: "img/skin.png",
|
2018-01-06 15:01:12 +01:00
|
|
|
capeUrl: "img/cape.png"
|
2017-10-01 14:17:34 +02:00
|
|
|
});
|
|
|
|
|
2018-02-11 16:39:33 +01:00
|
|
|
// Change the textures
|
|
|
|
skinViewer.skinUrl = "img/skin2.png";
|
|
|
|
skinViewer.capeUrl = "img/cape2.png";
|
2017-10-01 14:17:34 +02:00
|
|
|
|
2018-02-11 16:39:33 +01:00
|
|
|
// Resize the skin viewer
|
|
|
|
skinViewer.width = 300;
|
|
|
|
skinViewer.height = 400;
|
2017-10-01 14:17:34 +02:00
|
|
|
|
2018-02-11 16:39:33 +01:00
|
|
|
// Control objects with your mouse!
|
2018-02-12 02:46:07 +01:00
|
|
|
let control = skinview3d.createOrbitControls(skinViewer);
|
|
|
|
control.enableRotate = true;
|
|
|
|
control.enableZoom = false;
|
|
|
|
control.enablePan = false;
|
2018-01-06 15:01:12 +01:00
|
|
|
|
|
|
|
skinViewer.animation = new skinview3d.CompositeAnimation();
|
|
|
|
|
2018-02-11 16:39:33 +01:00
|
|
|
// Add an animation
|
|
|
|
let walk = skinViewer.animation.add(skinview3d.WalkingAnimation);
|
|
|
|
// Add another animation
|
|
|
|
let rotate = skinViewer.animation.add(skinview3d.RotatingAnimation);
|
|
|
|
// Remove an animation, stop walking dude
|
|
|
|
walk.remove();
|
|
|
|
// And run for now!
|
|
|
|
let run = skinViewer.animation.add(skinview3d.RunningAnimation);
|
2018-01-06 15:01:12 +01:00
|
|
|
|
2018-02-11 16:39:33 +01:00
|
|
|
// Set the speed of an animation
|
|
|
|
run.speed = 3;
|
|
|
|
// Pause single animation
|
2019-04-20 18:07:20 +02:00
|
|
|
run.speed = 0;
|
2018-02-11 16:39:33 +01:00
|
|
|
// Pause all animations!
|
2019-04-20 17:54:04 +02:00
|
|
|
skinViewer.animationSpeed = 0;
|
2017-10-01 14:17:34 +02:00
|
|
|
</script>
|
|
|
|
```
|
|
|
|
|
2017-10-01 14:00:45 +02:00
|
|
|
# Build
|
2017-10-02 15:29:41 +02:00
|
|
|
`npm run build`
|