Hacksore / skinpreview3d.js

A Three.js powered Minecraft skin viewer.
http://hacksore.github.io/skinpreview3d.js
GNU General Public License v3.0
12 stars 1 forks source link

Native javascript invocation to take object #9

Closed Hacksore closed 7 years ago

Hacksore commented 7 years ago

Might be a good idea to allow for the native JS invocation to have an object argument rather than several passed in.

So instead of this

var skinViewer = new skinpreview3d.SkinViewer(document.getElementById('skin_container'), 600, 600, true);

It could be refactored to something like this.

var skinViewer = new skinpreview3d.SkinViewer({
    domElement: document.getElementById('skin_container'),
    skinUrl: 'img/hatsune_miku.png',
    capeUrl: 'img/mojang_cape.png',
    slim: false,
    width: 600,
    height: 600
});

This will help for documentation as well as streamlining the two configurations for jQuery and native javascript.

yushijinhun commented 7 years ago

I agree with you. Also, I'd like to make width, height and model type(default or slim) modificable at runtime.

I want to add some other new features, such as the elytra support and customizable motions. It may take some time to implement them.

Sorry for the late reply. I'm busy these days because of the new semester.

Hacksore commented 7 years ago

This is not something that is needed ASAP just a nice consistency feature.

When you are speaking of elytra do you mean this https://minecraft.gamepedia.com/Elytra. I've been out of the Minecraft update loop for some time now but would that mean you'd like to implement the basic armor models as well?

Lastly, when you referred to height/width/model type at run time do you mean something like attributes in the HTML?

<div id="model" data-skin-url="/some/path" data-skin-type="slim"></div>