How to Get Started
Skin3D is a standalone 3D Minecraft skin viewer and editor. Follow these steps to set up and use the API in your own project.
1. Install skin3d
npm i skin3d
2. Basic Usage Example
<div id="skin_view_container"></div>
import * as skin3d from 'skin3d'
const viewer = new skin3d.View({
canvas: document.getElementById("skin_view_container"),
width: 300,
height: 400,
skin: "path-to-your-skin/your-skin.png"
});
// Optional: Add controls
viewer.controls.enableRotate = true;
viewer.controls.enableZoom = true;
viewer.controls.enablePan = false;
3. Loading Capes and Elytras
// Set a cape
viewer.loadCape("img/mojang_cape.png");
// Set an elytra
viewer.loadElytra("img/elytra.png");
4. Animations
viewer.animation = new skin3d.WalkingAnimation();
// Change speed
viewer.animation.speed = 1.2;
// Pause or resume
viewer.animation.paused = false;
5. More Features
- Change background:
viewer.setBackground("#c2b4ff");
- Change FOV:
viewer.fov = 70;
- Show/hide layers:
viewer.playerObject.skin.visible = false;
See the DOCUMENTATION for more advanced usage and API details.