• Stars
    star
    529
  • Rank 83,469 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Three.js powered Minecraft skin viewer.

skinview3d

CI Status NPM Package MIT License Gitter Chat

Three.js powered Minecraft skin viewer.

Features

  • 1.8 Skins
  • HD Skins
  • Capes
  • Ears
  • Elytras
  • Slim Arms
    • Automatic model detection (Slim / Default)
  • FXAA (fast approximate anti-aliasing)

Usage

Example of using skinview3d

<canvas id="skin_container"></canvas>
<script>
	let skinViewer = new skinview3d.SkinViewer({
		canvas: document.getElementById("skin_container"),
		width: 300,
		height: 400,
		skin: "img/skin.png"
	});

	// Change viewer size
	skinViewer.width = 600;
	skinViewer.height = 800;

	// Load another skin
	skinViewer.loadSkin("img/skin2.png");

	// Load a cape
	skinViewer.loadCape("img/cape.png");

	// Load an elytra (from a cape texture)
	skinViewer.loadCape("img/cape.png", { backEquipment: "elytra" });

	// Unload(hide) the cape / elytra
	skinViewer.loadCape(null);

	// Set the background color
	skinViewer.background = 0x5a76f3;

	// Set the background to a normal image
	skinViewer.loadBackground("img/background.png");

	// Set the background to a panoramic image
	skinViewer.loadPanorama("img/panorama1.png");

	// Change camera FOV
	skinViewer.fov = 70;

	// Zoom out
	skinViewer.zoom = 0.5;

	// Rotate the player
	skinViewer.autoRotate = true;

	// Apply an animation
	skinViewer.animation = new skinview3d.WalkingAnimation();

	// Set the speed of the animation
	skinViewer.animation.speed = 3;

	// Pause the animation
	skinViewer.animation.paused = true;

	// Remove the animation
	skinViewer.animation = null;
</script>

Lighting

By default, there are two lights on the scene. One is an ambient light, and the other is a point light from the camera.

To change the light intensity:

skinViewer.cameraLight.intensity = 0.9;
skinViewer.globalLight.intensity = 0.1;

Setting globalLight.intensity to 1.0 and cameraLight.intensity to 0.0 will completely disable shadows.

Ears

skinview3d supports two types of ear texture:

  • standalone: 14x7 image that contains the ear (example)
  • skin: Skin texture that contains the ear (e.g. deadmau5's skin)

Usage:

// You can specify ears in the constructor:
new skinview3d.SkinViewer({
	skin: "img/deadmau5.png",

	// Use ears drawn on the current skin (img/deadmau5.png)
	ears: "current-skin",

	// Or use ears from other textures
	ears: {
		textureType: "standalone", // "standalone" or "skin"
		source: "img/ears.png"
	}
});

// Show ears when loading skins:
skinViewer.loadSkin("img/deadmau5.png", { ears: true });

// Use ears from other textures:
skinViewer.loadEars("img/ears.png", { textureType: "standalone" });
skinViewer.loadEars("img/deadmau5.png", { textureType: "skin" });

Name Tag

Usage:

// Name tag with text "hello"
skinViewer.nameTag = "hello";

// Specify the text color
skinViewer.nameTag = new skinview3d.NameTagObject("hello", { textStyle: "yellow" });

// Unset the name tag
skinViewer.nameTag = null;

In order to display name tags correctly, you need the Minecraft font from South-Paw/typeface-minecraft. This font is available at assets/minecraft.woff2.

To load this font, please add the @font-face rule to your CSS:

@font-face {
	font-family: 'Minecraft';
	src: url('/path/to/minecraft.woff2') format('woff2');
}

Build

npm run build

More Repositories

1

blessing-skin-server

Web application brings your custom skins back in offline Minecraft servers.
PHP
829
star
2

awesome-minecraft

📝 The curated list of awesome things related to Minecraft.
439
star
3

blessing-skin-plugins

Official plugins for Blessing Skin.
PHP
77
star
4

yggdrasil-api

Please refer to https://github.com/bs-community/blessing-skin-plugins .
PHP
60
star
5

blessing-skin-manual

Manual of Blessing Skin Server.
TypeScript
23
star
6

customskinloader-gui

Online CustomSkinLoader configuration editor.
Svelte
16
star
7

skinview-utils

Utilities for working with Minecraft skins
TypeScript
13
star
8

blessing-skin-plugin-docs

Blessing Skin Server 插件开发文档
8
star
9

plugins-dist

8
star
10

unofficial-plugins-market

An unofficial plugins market for Blessing Skin Server.
PHP
8
star
11

docker

Blessing Skin in Docker.
Dockerfile
8
star
12

flarum-oauth-client

Login Flarum with Blessing Skin.
PHP
6
star
13

telegram-bot

Rust
4
star
14

plugin-template

Template repository for creating Blessing Skin plugin.
PHP
4
star
15

skinview2d

coming soon...
TypeScript
4
star
16

afdian-list-printer

Rust
3
star
17

rfcs

RFCs for changes to Blessing Skin.
3
star
18

texture-renderer

Minecraft texture renderer.
PHP
3
star
19

blessing-skin-shell

Web CLI for Blessing Skin.
Rust
2
star
20

bs-integration-for-wordpress

Blessing Skin integration for WordPress.
PHP
2
star
21

refresh-qcloud-cdn

当角色信息被更新时,自动刷新 CDN 中的 JSON Profile 的缓存。仅适用于腾讯云 CDN。
PHP
2
star
22

lite-admin-lte

PowerShell
1
star
23

nano

Infrastructure of building Blessing Skin plugins.
Rust
1
star
24

multi-index-style

A plugin for customizing index style for Blessing Skin Server.
HTML
1
star
25

update-source-server

简单的更新源服务端,适用于 Blessing Skin Server v4 "Tamias"
PHP
1
star
26

akua

Blessing Skin 版本通道切换工具。
Rust
1
star