GithubHelp home page GithubHelp logo

max-mapper / minecraft-skin Goto Github PK

View Code? Open in Web Editor NEW
59.0 5.0 21.0 356 KB

load minecraft skins as meshes in three.js applications

Home Page: http://maxogden.github.com/minecraft-skin/

JavaScript 100.00%

minecraft-skin's Introduction

minecraft-skin

load minecraft skins as meshes in three.js applications

originally written by @daniel_hede for this awesome demo, turned into a module and upgraded to r54 by @maxogden

minecraft is property of Mojang AB

var skin = require('minecraft-skin')
var viking = skin(THREE, 'viking.png')
viking.mesh.position.y = 50
scene.add(viking.mesh)

designed for use with browserify

license

BSD

minecraft-skin's People

Contributors

chrisdickinson avatar danfinlay avatar max-mapper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

minecraft-skin's Issues

New MC 1.8/1.7.6 skin support (64x64)

There are some enhancements planned for MC 1.7.6 (and/or 1.8?) adding more flexibility to skins:

http://minecraft.gamepedia.com/1.7.6

  • Right and left arms and legs are now editable independently
  • Uses a steve.png file with new layout and new dimensions
    • Dimensions for the file are now 64ร—64
  • Overlay now includes the whole body
  • Overlays are called hat, jacket, sleeves and pants legs
  • Backwards-compatible

from http://www.reddit.com/r/Minecraft/comments/1vd7ue/new_skin_layout_explanation_in_comments/, old is 64x32, new is 64x64:

sndkuc1

Zoom in to see better. Since the last snapshot (14w03) you can have separate texture for your left and right limbs. Also there is a 'hat' or 'armor' layer for all body pats, not only the head.
The 'armor' parts are marked with a '2'. They can be transparent of course.
LL - left leg
RL - right leg
LA - left arm
RA - right arm
This is the actual size you have to upload it in, so if you change this it will work! Also, if your skin is of the old size it will still work as it did before :)
EDIT: a better version by luci999: http://i.imgur.com/kZ6r4Ks.png
kz6r4ks

A guide to proper conversion process (if you just copy, the textures won't look proper): http://www.reddit.com/r/Minecraft/comments/1vfugk/guide_a_better_guide_to_updating_your_skin_to_the/ - http://imgur.com/a/hfaqL

wgmswmb

another guide,
from the same thread:
xdbpv6p

Uncaught TypeError: Cannot set property 'x' of undefined on index.js line 143

Line 137-144:

  uvs[ (0 + rotateBy) % 4 ].x = (tileU * tileUvWidth)
  uvs[ (0 + rotateBy) % 4 ].y = 1 - (tileV * tileUvHeight)
  uvs[ (1 + rotateBy) % 4 ].x = (tileU * tileUvWidth)
  uvs[ (1 + rotateBy) % 4 ].y = 1 - (tileV * tileUvHeight + h * tileUvHeight)
  uvs[ (2 + rotateBy) % 4 ].x = (tileU * tileUvWidth + w * tileUvWidth)
  uvs[ (2 + rotateBy) % 4 ].y = 1 - (tileV * tileUvHeight + h * tileUvHeight)
  uvs[ (3 + rotateBy) % 4 ].x = (tileU * tileUvWidth + w * tileUvWidth)
  uvs[ (3 + rotateBy) % 4 ].y = 1 - (tileV * tileUvHeight)

It seems that uvs has only three children, hence uvs[ (3 + rotateBy) % 4 ], where (3 + rotateBy) % 4 equals 3, reports the error.

I created the bundle.js as browserify demo.js -o bundle.js and replaced demo.js with bundle.js in index.html. Am I doing wrong or it is an real error?

Configurable fallback skin

If the specified skin doesn't load, there must be a way to fetch a fallback skin for voxel-steve.

The path should be overridable.

UV Mapping fails in modern versions of Three.js

I've just tried this out with a modern version of Three.js and got an error around line 142...

uvs[ (3 + rotateBy) % 4 ].x = (tileU * tileUvWidth + w * tileUvWidth)

I'm guessing the mesh building code has changed in three.js and it breaks the UVs somehow - but I don't really know what I'm doing so I couldn't work out how to fix it. :( It still works if you disable uv mapping, but then the man obviously looks retarded.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.