Socket
Socket
Sign inDemoInstall

avatar

Package Overview
Dependencies
116
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    avatar

skinned avatar player model for voxel games


Version published
Weekly downloads
211
increased by8.21%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

avatar

Skinnable avatar player model for voxel games

screenshot

This module is similar to @maxogden's minecraft-skin, but instead of using three.js, it uses gl-modules. Returns a gl-vao object containing the vertices and UV coordinates for the player model, for use with the provided vertex and fragment shaders.

For an example, run npm start or check out the live demo. Try dragging a skin image file from your hard disk onto the demo to change the textures.

The included example uses @substack's skin:

screenshot

Here's how the avatar looks when using changing it to screenshot, @maxogden skin:

screenshot

Or the classic "Steve" skin from Minecraft (not included):

screenshot

Skin formats

Currently supported:

  • Minecraft 1.7 and earlier (64x32) skin format
  • Minecraft 1.8 (64x64) skin format
  • High-resolution multiples of 64x32 or 64x32 (examples)

(Minecraft is property of Mojang Specifications).

Uniforms

  • mat4 projectionMatrix, modelViewMatrix: the usual transformation matrices
  • sampler2D skin: skin texture, should be in one of the above supported formats (for example from a gl-texture2d)
  • float rArmRotateX: right arm rotation X (radians)
  • float lArmRotateX: left arm rotation X (radians)
  • float rLegRotateX: right leg rotation X (radians)
  • float lLegRotateX: left leg rotation X (radians)

Example of setting the rotation uniforms:

screenshot

License

MIT

Keywords

FAQs

Last updated on 01 May 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc