skinview3d/README.md

67 lines
1.9 KiB
Markdown
Raw Normal View History

2017-10-01 14:17:34 +02:00
skinview3d
========
2019-09-11 15:13:53 +02:00
![](https://github.com/bs-community/skinview3d/workflows/CI/badge.svg)
2018-01-06 13:18:04 +01:00
[![npm](https://img.shields.io/npm/v/skinview3d.svg?style=flat-square)](https://www.npmjs.com/package/skinview3d)
2018-06-30 17:32:08 +02:00
[![license](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat-square)](https://github.com/bs-community/skinview3d/blob/master/LICENSE)
[![Gitter chat](https://img.shields.io/gitter/room/TechnologyAdvice/Stardust.svg?style=flat-square)](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.
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
* 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
run.paused = true;
// Pause all animations!
skinViewer.animationPaused = true;
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`