kihira / Tails

A small mod that adds in a variety of tails
MIT License
45 stars 22 forks source link

Change tail sizes #78

Open KitsuneDev opened 7 years ago

KitsuneDev commented 7 years ago

Hey Guys, I just was thinking: Why don't we add an slider to change tail sizes?? I think it would be something really nice. I'm trying to do it myself, but I don't think I will be able to do it.

KitsuneDev commented 7 years ago

My modifications until now:
uk.kihira.tails.client.model.tail:

    public ModelFluffyTail() {
        int tailLenght = 6;
        this.tailBase = new ModelRenderer(this);
        this.tailBase.addBox(-1, -1, 0, 2, 2, 3+tailLenght);
        this.tailBase.setRotationPoint(0, 0, 0);
        this.setRotationDegrees(this.tailBase, -15F, 0, 0);

        this.tail1 = new ModelRenderer(this, 10, 0);
        this.tail1.addBox(-1.5F, -1.5F, 0, 3, 3, 2+tailLenght);
        this.tail1.setRotationPoint(0, 0, 1.5F);
        this.setRotationDegrees(this.tail1, -15F, 0, 0);

        this.tail2 = new ModelRenderer(this, 0, 5);
        this.tail2.addBox(-2, -2, 0, 4, 4, 4+tailLenght);
        this.tail2.setRotationPoint(0, 0, 1.5F);
        this.setRotationDegrees(this.tail2, -15F, 0, 0);

        this.tail3 = new ModelRenderer(this, 0, 13);
        //20=8
        //                   ?,   ?,      side, back, down
        this.tail3.addBox(-2.5F, -2.5F, 0, 5, 5,15+tailLenght);
        this.tail3.setRotationPoint(0, 0, 3F);
        this.setRotationDegrees(this.tail3, -25F, 0, 0);

        this.tail4 = new ModelRenderer(this, 0, 26);
        this.tail4.addBox(-2, -2, 0, 4, 4, 2+tailLenght);
        this.tail4.setRotationPoint(0, 0, 7.4F);
        this.setRotationDegrees(this.tail4, 15F, 0, 0);

        this.tail5 = new ModelRenderer(this, 12, 26);
        this.tail5.addBox(-1.5F, -1.5F, 0, 3, 3, 2+tailLenght);
        this.tail5.setRotationPoint(0, 0, 1.4F);
        this.setRotationDegrees(this.tail5, 15F, 0, 0);

        this.tail4.addChild(this.tail5);
        this.tail3.addChild(this.tail4);
        this.tail2.addChild(this.tail3);
        this.tail1.addChild(this.tail2);
        this.tailBase.addChild(this.tail1);
    }

Generates some crazy tail rendering problems, but seems to be going the right way.

(EDIT: Rewording, my english back when I wrote this issue was quite messy)

kihira commented 7 years ago

Heya, sorry for not replying to this issue earlier.

It is something I'm considering and I might be able to throw it in the next release which should be within a few days :)

KitsuneDev commented 7 years ago

Ok, thank you very much. My code was a mess, since I Just discovered ForgeGradle and IntelliJ Idea aren't friends.

KitsuneDev commented 7 years ago

Is there any branch or something so we can try to help you with the next release??

KitsuneDev commented 7 years ago

Done Something which works +/-. Spacing between the parts is still too big and I don't know how to get the value from the GUI. Still trying (But wont give up :D). @kihira Do you mind if I reopen this so we can track progress? EDIT: Think I understood the spacing

KitsuneDev commented 7 years ago

My progress: https://github.com/GabrielTK/Tails ATM: Trying to find out how to read from the slider.

KitsuneDev commented 7 years ago

@kihira My fork is almost working, except because of the spacement problem. (HardCoded int values work as a multiplier, but on GUI, even if round, the spacement problem happens). Could you take a look at it pls?? I'll check the code and try again. INFO

kihira commented 7 years ago

Apologies, I've been rather busy so only had time to focus on bug fixes recently.

Your approach to doing the scale is close but wrong. What you're doing currently is enlarging each box size however its not really taking into account offsets of parts from each other. What would be the most ideal to do a Gl.scale call after all the transformations are complete but before the boxes are rendered, that should provide the results you want.

I do still hope to work on this and I actually have a system in place for Tails 2.0 to allow scaling parts

KitsuneDev commented 7 years ago

Ok, so I'm going to reset my fork and try this, even if it is not merged now, just for experience :D EDIT: Not sure if I know how to do it

KitsuneDev commented 7 years ago

Sorry @kihira to disturb you again, but do you plan to create a branch for 2.0 so we can see how things are going and help you to do it??

kihira commented 7 years ago

There isn't a specific branch but you can see the two latest feature branches have stuff related to it