Jump to content

[1.7.2] Custom Entity Model Damage Flash


Recommended Posts

I just noticed that one of the custom mob frames I built doesn't flash its tail when hurt like the rest of the body.


I'm looking through the minecraft code and I don't see anywhere that it specifies something special so a single part of the model flashes.


Anybody got experience with this or if it there is some special call that has to be made for the specialrender pass?

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

I think it happens in the doRender() method of RendererLivingEntity.  Look for where the hurtTime field is checked for > 0 as I believe that controls the 10 ticks of red coloring.


Not sure why one part of your model wouldn't color like the rest but I guess you can check the same field and color it yourself if needed.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I spotted that code and looked at it earlier.  I can't figure out why it wouldn't render all the parts of the entity either. 


I'm going to take a 2nd deep look and see if I can spot it.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

There's nothing there. It tells the model to do the render.  I'm stumped.


The Tail that isn't flashing is right between the body and the limbs which flash fine.  There is nothing I can find that should cause a break of the flash render at this spot. 



Just a snipet of the model render


















The only thing I can think of unique is up in the setrotation part, i'm shifting the tail to make it wag slowly.  This is similar to the arm/leg motion so can't image that would be an issue.



Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

That is weird.  Is there anything different about the way you created the ModelRenderer for those parts?  Are they children of another ModelRenderer or something?


I'm thinking that you might just want to check for the same condition and force the blend yourself and see if that works.


I feel like you and I are around the same skill level in Java and so I know you'll do the same stuff I would do.  But I would certainly expect the entire model to be affected by the blend if all the parts are rendered consecutively.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Please show your tail rendering code. it would be related with this issue.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Posted as requested, but I can't imagine what is relevant other than the sections above.  But then, i'm stumped so...



Here is the rendering class




public class MyRenderRaptor extends RenderLiving {


    // Setup Variables

Dimension_Multiplyer instance = Dimension_Multiplyer.instance;


    // setup Variables

    protected ResourceLocation texture;


    public MyRenderRaptor(String texture_name, float size) {   

        super(new ModelRaptor(), size);


        // Set Texture

        texture = new ResourceLocation("dimension_multiplyer", instance.textures().textures(texture_name));





    protected ResourceLocation getEntityTexture(Entity entity) {


    // Get the raptor

    MyEntityRaptor raptor = (MyEntityRaptor) entity;


    // Get type

    int type = raptor.type() - 1;

    if (type < 0) type = 0;


    // Generate texture

    texture = new ResourceLocation("dimension_multiplyer", instance.textures().textures("RAPTOR_" + type + "_PNG"));


        // return texture

        return texture;








Here is the model class.  Ignore the camo, haven't implemented it yet so always false. 




public class ModelRaptor extends ModelBase {


// Setup Tail angles

float tail_angleY = 0.0F;

float tail_angleY_incriment = 0.0005F;

float tail_angleY_limit = 0.05F;

float tail_angleY_growth = 0.2F;

int tail_angleY_direction = 1;


// Setup Scale

float shrink_factor = 2.0F;


// Setup Camo

boolean camo = false;


// Setup models

ModelRenderer head;

    ModelRenderer headb;

    ModelRenderer headuppera;

    ModelRenderer headupperb;

    ModelRenderer headlowera;

    ModelRenderer headlowerb;

    ModelRenderer tongue;

    ModelRenderer body;

    ModelRenderer neck;

    ModelRenderer rightarm;

    ModelRenderer righthanda;

    ModelRenderer righthandb;

    ModelRenderer leftarm;

    ModelRenderer lefthanda;

    ModelRenderer lefthandb;

    ModelRenderer leftleg;

    ModelRenderer leftlegb;

    ModelRenderer leftlegc;

    ModelRenderer leftfoottoe2b;

    ModelRenderer leftfoottoe1b;

    ModelRenderer leftfoottoe2a;

    ModelRenderer leftfoottoe1a;

    ModelRenderer leftfoot;

    ModelRenderer rightleg;

    ModelRenderer rightlegb;

    ModelRenderer rightlegc;

    ModelRenderer rightfoottoe1a;

    ModelRenderer rightfoottoe2b;

    ModelRenderer rightfoottoe2a;

    ModelRenderer rightfoottoe1b;

    ModelRenderer rightfoot;

    ModelRenderer taila;

    ModelRenderer tailb;

    ModelRenderer tailc;

    ModelRenderer taild;

    ModelRenderer taile;

    ModelRenderer tooth1a;

    ModelRenderer tooth2a;

    ModelRenderer tooth1b;

    ModelRenderer tooth2b;

    ModelRenderer tooth1c;

    ModelRenderer tooth2c;

    ModelRenderer tooth1d;

    ModelRenderer tooth2d;

    ModelRenderer tooth1e;

    ModelRenderer tooth2e;

    ModelRenderer tooth1f;

    ModelRenderer tooth2f;

    ModelRenderer tooth1g;

    ModelRenderer tooth2g;

    ModelRenderer tooth1h;

    ModelRenderer tooth2h;

    ModelRenderer tooth1i;

    ModelRenderer tooth2i;

    ModelRenderer tooth1j;

    ModelRenderer tooth2j;

    ModelRenderer tooth1k;

    ModelRenderer tooth2k;

    ModelRenderer tooth1l;

    ModelRenderer tooth2l;

    ModelRenderer tooth1m;

    ModelRenderer tooth2m;

    ModelRenderer tooth1n;

    ModelRenderer tooth2n;

    ModelRenderer tooth1o;

    ModelRenderer tooth2o;


    public ModelRaptor() {


    textureWidth = 256;

        textureHeight = 256;


        head = new ModelRenderer(this, 0, 0);

        head.addBox(-4F, -8F, -4F, 8, 7, 8);

        head.setRotationPoint(0F, -5F, -20F);

        head.setTextureSize(64, 32);

        head.mirror = true;

        setRotation(head, 0F, 0F, 0F);

        headb = new ModelRenderer(this, 40, 0);

        headb.addBox(-3F, -9F, -3F, 6, 1, 6);

        headb.setRotationPoint(0F, -5F, -20F);

        headb.setTextureSize(64, 32);

        headb.mirror = true;

        setRotation(headb, 0F, 0F, 0F);

        headuppera = new ModelRenderer(this, 0, 20);

        headuppera.addBox(-4F, -7F, -15F, 8, 1, 11);

        headuppera.setRotationPoint(0F, -5F, -20F);

        headuppera.setTextureSize(64, 32);

        headuppera.mirror = true;

        setRotation(headuppera, 0F, 0F, 0F);

        headupperb = new ModelRenderer(this, 45, 20);

        headupperb.addBox(-4F, -6F, -16F, 8, 1, 12);

        headupperb.setRotationPoint(0F, -5F, -20F);

        headupperb.setTextureSize(64, 32);

        headupperb.mirror = true;

        setRotation(headupperb, 0F, 0F, 0F);

        headlowera = new ModelRenderer(this, 0, 35);

        headlowera.addBox(-4F, -3.7F, -15F, 8, 1, 12);

        headlowera.setRotationPoint(0F, -5F, -20F);

        headlowera.setTextureSize(64, 32);

        headlowera.mirror = true;

        setRotation(headlowera, 0.1919862F, 0F, 0F);

        headlowerb = new ModelRenderer(this, 45, 35);

        headlowerb.addBox(-4F, -2.7F, -9F, 8, 1, 6);

        headlowerb.setRotationPoint(0F, -5F, -20F);

        headlowerb.setTextureSize(64, 32);

        headlowerb.mirror = true;

        setRotation(headlowerb, 0.1919862F, 0F, 0F);

        tongue = new ModelRenderer(this, 80, 35);

        tongue.addBox(-2F, -3.9F, -13F, 4, 1, 10);

        tongue.setRotationPoint(0F, -5F, -20F);

        tongue.setTextureSize(64, 32);

        tongue.mirror = true;

        setRotation(tongue, 0.1919862F, 0F, 0F);

        body = new ModelRenderer(this, 0, 55);

        body.addBox(-6F, -17F, -8F, 12, 21, 8);

        body.setRotationPoint(0F, 0F, 0F);

        body.setTextureSize(64, 32);

        body.mirror = true;

        setRotation(body, 1.308997F, 0F, 0F);

        neck = new ModelRenderer(this, 50, 55);

        neck.addBox(-4F, -18F, -16F, 8, 10, 6);

        neck.setRotationPoint(0F, 0F, 0F);

        neck.setTextureSize(64, 32);

        neck.mirror = true;

        setRotation(neck, 0.4363323F, 0F, 0F);

        rightarm = new ModelRenderer(this, 150, 50);

        rightarm.addBox(-2F, -1F, -1F, 2, 12, 2);

        rightarm.setRotationPoint(-6F, 0F, -16F);

        rightarm.setTextureSize(64, 32);

        rightarm.mirror = true;

        setRotation(rightarm, -0.7853982F, 0F, 0F);

        righthanda = new ModelRenderer(this, 170, 50);

        righthanda.addBox(-3F, 9F, 0F, 1, 4, 1);

        righthanda.setRotationPoint(-6F, 0F, -16F);

        righthanda.setTextureSize(64, 32);

        righthanda.mirror = true;

        setRotation(righthanda, -0.7853982F, -0.2792527F, 0F);

        righthandb = new ModelRenderer(this, 180, 50);

        righthandb.addBox(0F, 9F, -1F, 1, 4, 1);

        righthandb.setRotationPoint(-6F, 0F, -16F);

        righthandb.setTextureSize(64, 32);

        righthandb.mirror = true;

        setRotation(righthandb, -0.7853982F, 0.2792527F, 0F);

        leftarm = new ModelRenderer(this, 150, 80);

        leftarm.addBox(0F, -1F, -1F, 2, 12, 2);

        leftarm.setRotationPoint(6F, 0F, -16F);

        leftarm.setTextureSize(64, 32);

        leftarm.mirror = true;

        setRotation(leftarm, -0.7853982F, 0F, 0F);

        lefthanda = new ModelRenderer(this, 170, 80);

        lefthanda.addBox(2F, 9F, 0F, 1, 4, 1);

        lefthanda.setRotationPoint(6F, 0F, -16F);

        lefthanda.setTextureSize(64, 32);

        lefthanda.mirror = true;

        setRotation(lefthanda, -0.7853982F, 0.2792527F, 0F);

        lefthandb = new ModelRenderer(this, 180, 80);

        lefthandb.addBox(-1F, 10F, -1F, 1, 4, 1);

        lefthandb.setRotationPoint(6F, 0F, -15F);

        lefthandb.setTextureSize(64, 32);

        lefthandb.mirror = true;

        setRotation(lefthandb, -0.7853982F, -0.2792527F, 0.0174533F);

        leftleg = new ModelRenderer(this, 0, 120);

        leftleg.addBox(-3F, -2F, -2.5F, 3, 7, 5);

        leftleg.setRotationPoint(-6F, 2F, -3F);

        leftleg.setTextureSize(64, 32);

        leftleg.mirror = true;

        setRotation(leftleg, 0F, 0F, 0F);

        leftlegb = new ModelRenderer(this, 0, 140);

        leftlegb.addBox(-3F, 0F, -5F, 3, 15, 4);

        leftlegb.setRotationPoint(-6F, 2F, -3F);

        leftlegb.setTextureSize(64, 32);

        leftlegb.mirror = true;

        setRotation(leftlegb, 1.134464F, 0F, 0F);

        leftlegc = new ModelRenderer(this, 0, 165);

        leftlegc.addBox(-3F, 2.1F, 12F, 3, 15, 3);

        leftlegc.setRotationPoint(-6F, 2F, -3F);

        leftlegc.setTextureSize(64, 32);

        leftlegc.mirror = true;

        setRotation(leftlegc, -0.4363323F, 0F, 0F);

        leftfoottoe2b = new ModelRenderer(this, 37, 175);

        leftfoottoe2b.addBox(-4F, 20F, 0F, 1, 2, 1);

        leftfoottoe2b.setRotationPoint(-6F, 2F, -3F);

        leftfoottoe2b.setTextureSize(64, 32);

        leftfoottoe2b.mirror = true;

        setRotation(leftfoottoe2b, 0F, 0F, 0F);

        leftfoottoe1b = new ModelRenderer(this, 37, 165);

        leftfoottoe1b.addBox(0F, 20F, -2F, 1, 2, 2);

        leftfoottoe1b.setRotationPoint(-6F, 2F, -3F);

        leftfoottoe1b.setTextureSize(64, 32);

        leftfoottoe1b.mirror = true;

        setRotation(leftfoottoe1b, 0F, 0F, 0F);

        leftfoottoe2a = new ModelRenderer(this, 20, 175);

        leftfoottoe2a.addBox(-5F, 20F, 1F, 3, 2, 3);

        leftfoottoe2a.setRotationPoint(-6F, 2F, -3F);

        leftfoottoe2a.setTextureSize(64, 32);

        leftfoottoe2a.mirror = true;

        setRotation(leftfoottoe2a, 0F, 0F, 0F);

        leftfoottoe1a = new ModelRenderer(this, 20, 165);

        leftfoottoe1a.addBox(-1F, 20F, 0F, 3, 2, 4);

        leftfoottoe1a.setRotationPoint(-6F, 2F, -3F);

        leftfoottoe1a.setTextureSize(64, 32);

        leftfoottoe1a.mirror = true;

        setRotation(leftfoottoe1a, 0F, 0F, 0F);

        leftfoot = new ModelRenderer(this, 20, 140);

        leftfoot.addBox(-5F, 20F, 4F, 7, 2, 3);

        leftfoot.setRotationPoint(-6F, 2F, -3F);

        leftfoot.setTextureSize(64, 32);

        leftfoot.mirror = true;

        setRotation(leftfoot, 0F, 0F, 0F);

        rightleg = new ModelRenderer(this, 50, 120);

        rightleg.addBox(0F, -2F, -2.5F, 3, 7, 5);

        rightleg.setRotationPoint(6F, 2F, -3F);

        rightleg.setTextureSize(64, 32);

        rightleg.mirror = true;

        setRotation(rightleg, 0F, 0F, 0F);

        rightlegb = new ModelRenderer(this, 50, 140);

        rightlegb.addBox(0F, 0F, -5F, 3, 15, 4);

        rightlegb.setRotationPoint(6F, 2F, -3F);

        rightlegb.setTextureSize(64, 32);

        rightlegb.mirror = true;

        setRotation(rightlegb, 1.134464F, 0F, 0F);

        rightlegc = new ModelRenderer(this, 50, 165);

        rightlegc.addBox(0F, 2.1F, 12F, 3, 15, 3);

        rightlegc.setRotationPoint(6F, 2F, -3F);

        rightlegc.setTextureSize(64, 32);

        rightlegc.mirror = true;

        setRotation(rightlegc, -0.4363323F, 0F, 0F);

        rightfoottoe1a = new ModelRenderer(this, 70, 165);

        rightfoottoe1a.addBox(-2F, 20F, 0F, 3, 2, 4);

        rightfoottoe1a.setRotationPoint(6F, 2F, -3F);

        rightfoottoe1a.setTextureSize(64, 32);

        rightfoottoe1a.mirror = true;

        setRotation(rightfoottoe1a, 0F, 0F, 0F);

        rightfoottoe2b = new ModelRenderer(this, 87, 175);

        rightfoottoe2b.addBox(3F, 20F, 0F, 1, 2, 1);

        rightfoottoe2b.setRotationPoint(6F, 2F, -3F);

        rightfoottoe2b.setTextureSize(64, 32);

        rightfoottoe2b.mirror = true;

        setRotation(rightfoottoe2b, 0F, 0F, 0F);

        rightfoottoe2a = new ModelRenderer(this, 70, 175);

        rightfoottoe2a.addBox(2F, 20F, 1F, 3, 2, 3);

        rightfoottoe2a.setRotationPoint(6F, 2F, -3F);

        rightfoottoe2a.setTextureSize(64, 32);

        rightfoottoe2a.mirror = true;

        setRotation(rightfoottoe2a, 0F, 0F, 0F);

        rightfoottoe1b = new ModelRenderer(this, 87, 165);

        rightfoottoe1b.addBox(-1F, 20F, -2F, 1, 2, 2);

        rightfoottoe1b.setRotationPoint(6F, 2F, -3F);

        rightfoottoe1b.setTextureSize(64, 32);

        rightfoottoe1b.mirror = true;

        setRotation(rightfoottoe1b, 0F, 0F, 0F);

        rightfoot = new ModelRenderer(this, 70, 140);

        rightfoot.addBox(-2F, 20F, 4F, 7, 2, 3);

        rightfoot.setRotationPoint(6F, 2F, -3F);

        rightfoot.setTextureSize(64, 32);

        rightfoot.mirror = true;

        setRotation(rightfoot, 0F, 0F, 0F);

        taila = new ModelRenderer(this, 0, 95);

        taila.addBox(-5F, 2F, -8F, 10, 10, 7);

        taila.setRotationPoint(0F, 0F, 0F);

        taila.setTextureSize(64, 32);

        taila.mirror = true;

        setRotation(taila, 1.500983F, 0F, 0F);

        tailb = new ModelRenderer(this, 40, 95);

        tailb.addBox(-4F, 11F, -7F, 8, 10, 5);

        tailb.setRotationPoint(0F, 0F, 0F);

        tailb.setTextureSize(64, 32);

        tailb.mirror = true;

        setRotation(tailb, 1.500983F, 0F, 0F);

        tailc = new ModelRenderer(this, 70, 95);

        tailc.addBox(-3F, 20F, -6F, 6, 10, 3);

        tailc.setRotationPoint(0F, 0F, 0F);

        tailc.setTextureSize(64, 32);

        tailc.mirror = true;

        setRotation(tailc, 1.500983F, 0F, 0F);

        taild = new ModelRenderer(this, 95, 95);

        taild.addBox(-2F, 29F, -5F, 4, 5, 1);

        taild.setRotationPoint(0F, 0F, 0F);

        taild.setTextureSize(64, 32);

        taild.mirror = true;

        setRotation(taild, 1.500983F, 0F, 0F);

        taile = new ModelRenderer(this, 110, 95);

        taile.addBox(-1F, 33F, -5F, 2, 5, 1);

        taile.setRotationPoint(0F, 0F, 0F);

        taile.setTextureSize(64, 32);

        taile.mirror = true;

        setRotation(taile, 1.500983F, 0F, 0F);

        tooth1a = new ModelRenderer(this, 250, 0);

        tooth1a.addBox(-3.9F, -12.5F, -8.9F, 1, 1, 1);

        tooth1a.setRotationPoint(0F, -5F, -20F);

        tooth1a.setTextureSize(64, 32);

        tooth1a.mirror = true;

        setRotation(tooth1a, 0.9075712F, 0F, 0F);

        tooth2a = new ModelRenderer(this, 250, 0);

        tooth2a.addBox(2.9F, -12.5F, -8.9F, 1, 1, 1);

        tooth2a.setRotationPoint(0F, -5F, -20F);

        tooth2a.setTextureSize(64, 32);

        tooth2a.mirror = true;

        setRotation(tooth2a, 0.9075712F, 0F, 0F);

        tooth1b = new ModelRenderer(this, 250, 0);

        tooth1b.addBox(-3.9F, -11.6F, -7.9F, 1, 1, 1);

        tooth1b.setRotationPoint(0F, -5F, -20F);

        tooth1b.setTextureSize(64, 32);

        tooth1b.mirror = true;

        setRotation(tooth1b, 0.9075712F, 0F, 0F);

        tooth2b = new ModelRenderer(this, 250, 0);

        tooth2b.addBox(2.9F, -11.6F, -7.9F, 1, 1, 1);

        tooth2b.setRotationPoint(0F, -5F, -20F);

        tooth2b.setTextureSize(64, 32);

        tooth2b.mirror = true;

        setRotation(tooth2b, 0.9075712F, 0F, 0F);

        tooth1c = new ModelRenderer(this, 250, 0);

        tooth1c.addBox(-3.9F, -10.7F, -6.9F, 1, 1, 1);

        tooth1c.setRotationPoint(0F, -5F, -20F);

        tooth1c.setTextureSize(64, 32);

        tooth1c.mirror = true;

        setRotation(tooth1c, 0.9075712F, 0F, 0F);

        tooth2c = new ModelRenderer(this, 250, 0);

        tooth2c.addBox(2.9F, -10.7F, -6.9F, 1, 1, 1);

        tooth2c.setRotationPoint(0F, -5F, -20F);

        tooth2c.setTextureSize(64, 32);

        tooth2c.mirror = true;

        setRotation(tooth2c, 0.9075712F, 0F, 0F);

        tooth1d = new ModelRenderer(this, 250, 0);

        tooth1d.addBox(-3.9F, -9.8F, -5.9F, 1, 1, 1);

        tooth1d.setRotationPoint(0F, -5F, -20F);

        tooth1d.setTextureSize(64, 32);

        tooth1d.mirror = true;

        setRotation(tooth1d, 0.9075712F, 0F, 0F);

        tooth2d = new ModelRenderer(this, 250, 0);

        tooth2d.addBox(2.9F, -9.8F, -5.9F, 1, 1, 1);

        tooth2d.setRotationPoint(0F, -5F, -20F);

        tooth2d.setTextureSize(64, 32);

        tooth2d.mirror = true;

        setRotation(tooth2d, 0.9075712F, 0F, 0F);

        tooth1e = new ModelRenderer(this, 250, 0);

        tooth1e.addBox(-3.9F, -8.9F, -4.9F, 1, 1, 1);

        tooth1e.setRotationPoint(0F, -5F, -20F);

        tooth1e.setTextureSize(64, 32);

        tooth1e.mirror = true;

        setRotation(tooth1e, 0.9075712F, 0F, 0F);

        tooth2e = new ModelRenderer(this, 250, 0);

        tooth2e.addBox(2.9F, -8.9F, -4.9F, 1, 1, 1);

        tooth2e.setRotationPoint(0F, -5F, -20F);

        tooth2e.setTextureSize(64, 32);

        tooth2e.mirror = true;

        setRotation(tooth2e, 0.9075712F, 0F, 0F);

        tooth1f = new ModelRenderer(this, 250, 0);

        tooth1f.addBox(-3.9F, -8F, -3.9F, 1, 1, 1);

        tooth1f.setRotationPoint(0F, -5F, -20F);

        tooth1f.setTextureSize(64, 32);

        tooth1f.mirror = true;

        setRotation(tooth1f, 0.9075712F, 0F, 0F);

        tooth2f = new ModelRenderer(this, 250, 0);

        tooth2f.addBox(2.9F, -8F, -3.9F, 1, 1, 1);

        tooth2f.setRotationPoint(0F, -5F, -20F);

        tooth2f.setTextureSize(64, 32);

        tooth2f.mirror = true;

        setRotation(tooth2f, 0.9075712F, 0F, 0F);

        tooth1g = new ModelRenderer(this, 250, 0);

        tooth1g.addBox(-3.9F, -7.1F, -2.9F, 1, 1, 1);

        tooth1g.setRotationPoint(0F, -5F, -20F);

        tooth1g.setTextureSize(64, 32);

        tooth1g.mirror = true;

        setRotation(tooth1g, 0.9075712F, 0F, 0F);

        tooth2g = new ModelRenderer(this, 250, 0);

        tooth2g.addBox(2.9F, -7.1F, -2.9F, 1, 1, 1);

        tooth2g.setRotationPoint(0F, -5F, -20F);

        tooth2g.setTextureSize(64, 32);

        tooth2g.mirror = true;

        setRotation(tooth2g, 0.9075712F, 0F, 0F);

        tooth1h = new ModelRenderer(this, 250, 0);

        tooth1h.addBox(-3.9F, -6.2F, -1.9F, 1, 1, 1);

        tooth1h.setRotationPoint(0F, -5F, -20F);

        tooth1h.setTextureSize(64, 32);

        tooth1h.mirror = true;

        setRotation(tooth1h, 0.9075712F, 0F, 0F);

        tooth2h = new ModelRenderer(this, 250, 0);

        tooth2h.addBox(2.9F, -6.2F, -1.9F, 1, 1, 1);

        tooth2h.setRotationPoint(0F, -5F, -20F);

        tooth2h.setTextureSize(64, 32);

        tooth2h.mirror = true;

        setRotation(tooth2h, 0.9075712F, 0F, 0F);

        tooth1i = new ModelRenderer(this, 250, 0);

        tooth1i.addBox(-3.9F, -14.5F, -7.3F, 1, 1, 1);

        tooth1i.setRotationPoint(0F, -5F, -20F);

        tooth1i.setTextureSize(64, 32);

        tooth1i.mirror = true;

        setRotation(tooth1i, 0.7853982F, 0F, 0F);

        tooth2i = new ModelRenderer(this, 250, 0);

        tooth2i.addBox(2.9F, -14.5F, -7.3F, 1, 1, 1);

        tooth2i.setRotationPoint(0F, -5F, -20F);

        tooth2i.setTextureSize(64, 32);

        tooth2i.mirror = true;

        setRotation(tooth2i, 0.7853982F, 0F, 0F);

        tooth1j = new ModelRenderer(this, 250, 0);

        tooth1j.addBox(-3.9F, -13.5F, -6.3F, 1, 1, 1);

        tooth1j.setRotationPoint(0F, -5F, -20F);

        tooth1j.setTextureSize(64, 32);

        tooth1j.mirror = true;

        setRotation(tooth1j, 0.7853982F, 0F, 0F);

        tooth2j = new ModelRenderer(this, 250, 0);

        tooth2j.addBox(2.9F, -13.5F, -6.3F, 1, 1, 1);

        tooth2j.setRotationPoint(0F, -5F, -20F);

        tooth2j.setTextureSize(64, 32);

        tooth2j.mirror = true;

        setRotation(tooth2j, 0.7853982F, 0F, 0F);

        tooth1k = new ModelRenderer(this, 250, 0);

        tooth1k.addBox(-3.9F, -12.5F, -5.3F, 1, 1, 1);

        tooth1k.setRotationPoint(0F, -5F, -20F);

        tooth1k.setTextureSize(64, 32);

        tooth1k.mirror = true;

        setRotation(tooth1k, 0.7853982F, 0F, 0F);

        tooth2k = new ModelRenderer(this, 250, 0);

        tooth2k.addBox(2.9F, -12.5F, -5.3F, 1, 1, 1);

        tooth2k.setRotationPoint(0F, -5F, -20F);

        tooth2k.setTextureSize(64, 32);

        tooth2k.mirror = true;

        setRotation(tooth2k, 0.7853982F, 0F, 0F);

        tooth1l = new ModelRenderer(this, 250, 0);

        tooth1l.addBox(-3.9F, -11.5F, -4.3F, 1, 1, 1);

        tooth1l.setRotationPoint(0F, -5F, -20F);

        tooth1l.setTextureSize(64, 32);

        tooth1l.mirror = true;

        setRotation(tooth1l, 0.7853982F, 0F, 0F);

        tooth2l = new ModelRenderer(this, 250, 0);

        tooth2l.addBox(2.9F, -11.5F, -4.3F, 1, 1, 1);

        tooth2l.setRotationPoint(0F, -5F, -20F);

        tooth2l.setTextureSize(64, 32);

        tooth2l.mirror = true;

        setRotation(tooth2l, 0.7853982F, 0F, 0F);

        tooth1m = new ModelRenderer(this, 250, 0);

        tooth1m.addBox(-3.9F, -10.5F, -3.3F, 1, 1, 1);

        tooth1m.setRotationPoint(0F, -5F, -20F);

        tooth1m.setTextureSize(64, 32);

        tooth1m.mirror = true;

        setRotation(tooth1m, 0.7853982F, 0F, 0F);

        tooth2m = new ModelRenderer(this, 250, 0);

        tooth2m.addBox(2.9F, -10.5F, -3.3F, 1, 1, 1);

        tooth2m.setRotationPoint(0F, -5F, -20F);

        tooth2m.setTextureSize(64, 32);

        tooth2m.mirror = true;

        setRotation(tooth2m, 0.7853982F, 0F, 0F);

        tooth1n = new ModelRenderer(this, 250, 0);

        tooth1n.addBox(-3.9F, -9.5F, -2.3F, 1, 1, 1);

        tooth1n.setRotationPoint(0F, -5F, -20F);

        tooth1n.setTextureSize(64, 32);

        tooth1n.mirror = true;

        setRotation(tooth1n, 0.7853982F, 0F, 0F);

        tooth2n = new ModelRenderer(this, 250, 0);

        tooth2n.addBox(2.9F, -9.5F, -2.3F, 1, 1, 1);

        tooth2n.setRotationPoint(0F, -5F, -20F);

        tooth2n.setTextureSize(64, 32);

        tooth2n.mirror = true;

        setRotation(tooth2n, 0.7853982F, 0F, 0F);

        tooth1o = new ModelRenderer(this, 250, 0);

        tooth1o.addBox(-3.9F, -8.5F, -1.3F, 1, 1, 1);

        tooth1o.setRotationPoint(0F, -5F, -20F);

        tooth1o.setTextureSize(64, 32);

        tooth1o.mirror = true;

        setRotation(tooth1o, 0.7853982F, 0F, 0F);

        tooth2o = new ModelRenderer(this, 250, 0);

        tooth2o.addBox(2.9F, -8.5F, -1.3F, 1, 1, 1);

        tooth2o.setRotationPoint(0F, -5F, -20F);

        tooth2o.setTextureSize(64, 32);

        tooth2o.mirror = true;

        setRotation(tooth2o, 0.7853982F, 0F, 0F);




    public void setRotation(ModelRenderer model, float x, float y, float z) {


        model.rotateAngleX = x;

        model.rotateAngleY = y;

        model.rotateAngleZ = z;




    // f & f1 are some type of limb movement factors



    public void setRotationAngles(float limb_angle, float limb_progress, float f2, float f3, float f4, float f5, Entity entity) {

        super.setRotationAngles(limb_angle, limb_progress, f2, f3, f4, f5, entity);


        // Handle Walking Animation

        float limb_angle_multiplier = 0.6662F;  // 0.6662F Original

        float limb_rotation_multiplier = 0.7F;  // 1.4F Original


        leftleg.rotateAngleX = MathHelper.cos(limb_angle * limb_angle_multiplier) * limb_rotation_multiplier * limb_progress;

        rightleg.rotateAngleX = MathHelper.cos(limb_angle * limb_angle_multiplier + (float)Math.PI) * limb_rotation_multiplier * limb_progress;


        // Handle Tail Wag Animation

        tail_angleY = tail_angleY  + tail_angleY_incriment * tail_angleY_direction;

        if (tail_angleY >= tail_angleY_limit) tail_angleY_direction = -1;

        if (tail_angleY <= (-tail_angleY_limit)) tail_angleY_direction = 1;


        // Handle Jaw

        MyEntityRaptor raptor = (MyEntityRaptor) entity;

        float jaw_position = raptor.jaw_position();

        //if (jaw_position > 0) System.out.println("Jaw of " + jaw_position);


        //System.out.println("tail_angleY = " + tail_angleY);



        // Head       

        headb.rotateAngleX = head.rotateAngleX;

        headb.rotateAngleY = head.rotateAngleY;

        headb.rotateAngleZ = head.rotateAngleZ;


        // Upper Jaw

        headuppera.rotateAngleX = head.rotateAngleX;

        headuppera.rotateAngleY = head.rotateAngleY;

        headuppera.rotateAngleZ = head.rotateAngleZ;


        headupperb.rotateAngleX = headuppera.rotateAngleX;

        headupperb.rotateAngleY = headuppera.rotateAngleY;

        headupperb.rotateAngleZ = headuppera.rotateAngleZ;


        tooth1i.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth1i.rotateAngleY = headuppera.rotateAngleY;

        tooth1i.rotateAngleZ = headuppera.rotateAngleZ;


        tooth2i.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth2i.rotateAngleY = headuppera.rotateAngleY;

        tooth2i.rotateAngleZ = headuppera.rotateAngleZ;


        tooth1j.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth1j.rotateAngleY = headuppera.rotateAngleY;

        tooth1j.rotateAngleZ = headuppera.rotateAngleZ;


        tooth2j.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth2j.rotateAngleY = headuppera.rotateAngleY;

        tooth2j.rotateAngleZ = headuppera.rotateAngleZ;


        tooth1k.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth1k.rotateAngleY = headuppera.rotateAngleY;

        tooth1k.rotateAngleZ = headuppera.rotateAngleZ;


        tooth2k.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth2k.rotateAngleY = headuppera.rotateAngleY;

        tooth2k.rotateAngleZ = headuppera.rotateAngleZ;


        tooth1l.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth1l.rotateAngleY = headuppera.rotateAngleY;

        tooth1l.rotateAngleZ = headuppera.rotateAngleZ;


        tooth2l.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth2l.rotateAngleY = headuppera.rotateAngleY;

        tooth2l.rotateAngleZ = headuppera.rotateAngleZ;


        tooth1m.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth1m.rotateAngleY = headuppera.rotateAngleY;

        tooth1m.rotateAngleZ = headuppera.rotateAngleZ;


        tooth2m.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth2m.rotateAngleY = headuppera.rotateAngleY;

        tooth2m.rotateAngleZ = headuppera.rotateAngleZ;


        tooth1n.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth1n.rotateAngleY = headuppera.rotateAngleY;

        tooth1n.rotateAngleZ = headuppera.rotateAngleZ;


        tooth2n.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth2n.rotateAngleY = headuppera.rotateAngleY;

        tooth2n.rotateAngleZ = headuppera.rotateAngleZ;


        tooth1o.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth1o.rotateAngleY = headuppera.rotateAngleY;

        tooth1o.rotateAngleZ = headuppera.rotateAngleZ;


        tooth2o.rotateAngleX = headuppera.rotateAngleX + 0.7853982F;

        tooth2o.rotateAngleY = headuppera.rotateAngleY;

        tooth2o.rotateAngleZ = headuppera.rotateAngleZ;


        // Lower Jaw       

        headlowera.rotateAngleX = head.rotateAngleX + 0.1919862F - jaw_position;

        headlowera.rotateAngleY = head.rotateAngleY;

        headlowera.rotateAngleZ = head.rotateAngleZ;


        headlowerb.rotateAngleX = headlowera.rotateAngleX;

        headlowerb.rotateAngleY = headlowera.rotateAngleY;

        headlowerb.rotateAngleZ = headlowera.rotateAngleZ;


        tongue.rotateAngleX = headlowera.rotateAngleX;

        tongue.rotateAngleY = headlowera.rotateAngleY;

        tongue.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1a.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1a.rotateAngleY = headlowera.rotateAngleY;

        tooth1a.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2a.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2a.rotateAngleY = headlowera.rotateAngleY;

        tooth2a.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1b.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1b.rotateAngleY = headlowera.rotateAngleY;

        tooth1b.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2b.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2b.rotateAngleY = headlowera.rotateAngleY;

        tooth2b.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1c.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1c.rotateAngleY = headlowera.rotateAngleY;

        tooth1c.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2c.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2c.rotateAngleY = headlowera.rotateAngleY;

        tooth2c.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1d.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1d.rotateAngleY = headlowera.rotateAngleY;

        tooth1d.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2d.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2d.rotateAngleY = headlowera.rotateAngleY;

        tooth2d.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1e.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1e.rotateAngleY = headlowera.rotateAngleY;

        tooth1e.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2e.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2e.rotateAngleY = headlowera.rotateAngleY;

        tooth2e.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1f.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1f.rotateAngleY = headlowera.rotateAngleY;

        tooth1f.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2f.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2f.rotateAngleY = headlowera.rotateAngleY;

        tooth2f.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1g.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1g.rotateAngleY = headlowera.rotateAngleY;

        tooth1g.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2g.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2g.rotateAngleY = headlowera.rotateAngleY;

        tooth2g.rotateAngleZ = headlowera.rotateAngleZ;


        tooth1h.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth1h.rotateAngleY = headlowera.rotateAngleY;

        tooth1h.rotateAngleZ = headlowera.rotateAngleZ;


        tooth2h.rotateAngleX = headlowera.rotateAngleX + (0.9075712F - 0.1919862F);

        tooth2h.rotateAngleY = headlowera.rotateAngleY;

        tooth2h.rotateAngleZ = headlowera.rotateAngleZ;


        // Handle Body

        neck.rotateAngleX = body.rotateAngleX + (0.4363323F - 1.308997F);

        neck.rotateAngleY = body.rotateAngleY;

        neck.rotateAngleZ = body.rotateAngleZ;


        taila.rotateAngleX = body.rotateAngleX + (1.500983F - 1.308997F);

        taila.rotateAngleY = body.rotateAngleY + tail_angleY;

        taila.rotateAngleZ = body.rotateAngleZ;


        tailb.rotateAngleX = taila.rotateAngleX;

        tailb.rotateAngleY = taila.rotateAngleY + tail_angleY * (1 + 1 * tail_angleY_growth);

        tailb.rotateAngleZ = taila.rotateAngleZ;


        tailc.rotateAngleX = taila.rotateAngleX;

        tailc.rotateAngleY = taila.rotateAngleY + tail_angleY * (1 + 2 * tail_angleY_growth);

        tailc.rotateAngleZ = taila.rotateAngleZ;


        taild.rotateAngleX = taila.rotateAngleX;

        taild.rotateAngleY = taila.rotateAngleY + tail_angleY * (1 + 3 * tail_angleY_growth);

        taild.rotateAngleZ = taila.rotateAngleZ;


        taile.rotateAngleX = taila.rotateAngleX;

        taile.rotateAngleY = taila.rotateAngleY + tail_angleY * (1 + 4 * tail_angleY_growth);

        taile.rotateAngleZ = taila.rotateAngleZ;


        // Handle Left arm

        lefthanda.rotateAngleX = leftarm.rotateAngleX + (-0.7853982F - (-0.7853982F));

        lefthanda.rotateAngleY = leftarm.rotateAngleY + 0.2792527F;

        lefthanda.rotateAngleZ = leftarm.rotateAngleZ;


        lefthandb.rotateAngleX = leftarm.rotateAngleX + (-0.7853982F - (-0.7853982F));

        lefthandb.rotateAngleY = leftarm.rotateAngleY + (-0.2792527F);

        lefthandb.rotateAngleZ = leftarm.rotateAngleZ;


        // Handle right arm

        righthanda.rotateAngleX = rightarm.rotateAngleX + (-0.7853982F - (-0.7853982F));

        righthanda.rotateAngleY = rightarm.rotateAngleY + (-0.2792527F);

        righthanda.rotateAngleZ = rightarm.rotateAngleZ;


        righthandb.rotateAngleX = rightarm.rotateAngleX + (-0.7853982F - (-0.7853982F));;

        righthandb.rotateAngleY = rightarm.rotateAngleY + 0.2792527F;

        righthandb.rotateAngleZ = rightarm.rotateAngleZ;


        // Handle Left leg

        leftlegb.rotateAngleX = leftleg.rotateAngleX + 1.134464F;

        leftlegb.rotateAngleY = leftleg.rotateAngleY;

        leftlegb.rotateAngleZ = leftleg.rotateAngleZ;


        leftlegc.rotateAngleX = leftleg.rotateAngleX + (-0.4363323F);

        leftlegc.rotateAngleY = leftleg.rotateAngleY;

        leftlegc.rotateAngleZ = leftleg.rotateAngleZ;


        leftfoot.rotateAngleX = leftleg.rotateAngleX;

        leftfoot.rotateAngleY = leftleg.rotateAngleY;

        leftfoot.rotateAngleZ = leftleg.rotateAngleZ;


        leftfoottoe1a.rotateAngleX = leftfoot.rotateAngleX;

        leftfoottoe1a.rotateAngleY = leftfoot.rotateAngleY;

        leftfoottoe1a.rotateAngleZ = leftfoot.rotateAngleZ;


        leftfoottoe2a.rotateAngleX = leftfoot.rotateAngleX;

        leftfoottoe2a.rotateAngleY = leftfoot.rotateAngleY;

        leftfoottoe2a.rotateAngleZ = leftfoot.rotateAngleZ;


        leftfoottoe1b.rotateAngleX = leftfoot.rotateAngleX;

        leftfoottoe1b.rotateAngleY = leftfoot.rotateAngleY;

        leftfoottoe1b.rotateAngleZ = leftfoot.rotateAngleZ;


        leftfoottoe2b.rotateAngleX = leftfoot.rotateAngleX;

        leftfoottoe2b.rotateAngleY = leftfoot.rotateAngleY;

        leftfoottoe2b.rotateAngleZ = leftfoot.rotateAngleZ;


        // Handle Right leg

        rightlegb.rotateAngleX = rightleg.rotateAngleX + 1.134464F;

        rightlegb.rotateAngleY = rightleg.rotateAngleY;

        rightlegb.rotateAngleZ = rightleg.rotateAngleZ;


        rightlegc.rotateAngleX = rightleg.rotateAngleX + (-0.4363323F);

        rightlegc.rotateAngleY = rightleg.rotateAngleY;

        rightlegc.rotateAngleZ = rightleg.rotateAngleZ;


        rightfoot.rotateAngleX = rightleg.rotateAngleX;

        rightfoot.rotateAngleY = rightleg.rotateAngleY;

        rightfoot.rotateAngleZ = rightleg.rotateAngleZ;


        rightfoottoe1a.rotateAngleX = rightfoot.rotateAngleX;

        rightfoottoe1a.rotateAngleY = rightfoot.rotateAngleY;

        rightfoottoe1a.rotateAngleZ = rightfoot.rotateAngleZ;


        rightfoottoe2a.rotateAngleX = rightfoot.rotateAngleX;

        rightfoottoe2a.rotateAngleY = rightfoot.rotateAngleY;

        rightfoottoe2a.rotateAngleZ = rightfoot.rotateAngleZ;


        rightfoottoe1b.rotateAngleX = rightfoot.rotateAngleX;

        rightfoottoe1b.rotateAngleY = rightfoot.rotateAngleY;

        rightfoottoe1b.rotateAngleZ = rightfoot.rotateAngleZ;


        rightfoottoe2b.rotateAngleX = rightfoot.rotateAngleX;

        rightfoottoe2b.rotateAngleY = rightfoot.rotateAngleY;

        rightfoottoe2b.rotateAngleZ = rightfoot.rotateAngleZ;





    public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {


    // Set Rotation

        this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);


        // Initiate Matrix



        // Test for camo

        if (camo) {



            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);




        // Determine if Child or adult

        if (this.isChild) {


        // Increase shrink for child

        shrink_factor = shrink_factor / 2;


        // Set Scale

            GL11.glScalef(1.5F / shrink_factor, 1.5F / shrink_factor, 1.5F / shrink_factor);

            GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F);


        } else {


        // Set Scale

        GL11.glScalef(1.0F / shrink_factor, 1.0F / shrink_factor, 1.0F / shrink_factor);

            GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);









































        // Set Scale

        GL11.glScalef(0.995F, 1.0F, 1.0F);





        GL11.glScalef(1 / 0.995F, 1.0F, 1.0F);



        // Determine if Child or adult

        if (this.isChild) {


        // Test for camo

            if (camo) GL11.glDisable(GL11.GL_BLEND);


        // Finish Matrix



        // Start Matrix



            // Test for camo

            if (camo) {



                GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);




            // Set Scale

            GL11.glScalef(1.0F / shrink_factor, 1.0F / shrink_factor, 1.0F / shrink_factor);

            GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);






































        // Handle Smaller Parts


        // Set Scale

        GL11.glScalef(0.995F, 1.0F, 1.0F);







        // Test for camo

        if (camo) GL11.glDisable(GL11.GL_BLEND);


        // Finish Matrix








Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Not necessarily related to your problem, but are all those parts (like every separate tooth) going to move/animate separately from each other?  If not, you don't need each one to have a separate ModelRenderer.  Rather you can simply add more boxes to the head to add the teeth and such.


And if you're going to move some part, like the tail, you should really do them as children of the part they are attached too.  Then you don't have to move them if the other parts rotate.


Check out my tutorial on this: http://jabelarminecraft.blogspot.com/p/complex-entity-models-including.html


In that tutorial I create a complex model (a snake) with multiple moving parts, but I only have to render one part because all the others are children.


Anyway, my suggestion is that no part of the model should be truly separate from the others unless you want to go crazy trying to figure out the trigonometry or unless they are truly logically independent (in terms of movement or special transformations/blending).  The parts should be directly added (if they don't move on their own), or be a child (if they move on their own).

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites



I gave the child thing a shot, but everything was offset odd that I made a child object.


I played around with it but couldn't figure out the basis for how it was offsetting the child renders from the parent.  Its probably obvious and i'm just missing it. 


On some of my boxes, I need to shrink them so the textures don't flicker with the overlap.  From what I read, that wouldn't work for child objects, but it would be very handy for all the teeth and a few other items.




Anyone else reading this, any clue on why the tail doesn't show the damage?  I can make it do it the hard way, but I can't figure out why it isn't doing it as is shown in the above code.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites



I gave the child thing a shot, but everything was offset odd that I made a child object.


I played around with it but couldn't figure out the basis for how it was offsetting the child renders from the parent.  Its probably obvious and i'm just missing it. 


On some of my boxes, I need to shrink them so the textures don't flicker with the overlap.  From what I read, that wouldn't work for child objects, but it would be very handy for all the teeth and a few other items.


Yes, the offsets need to be adjusted because the become relative.  It is a bit of work, but worth it.


The way it works is this -- the offset is relative to the rotation point, and the child's rotation point is relative to the parent's rotation point.


So generally I think you can just subtract the parent's rotation point from the child's.  Note though that if you're actually going to rotate the child you should ensure the offset is really what you want (i.e. the tail's rotation point should be at the end that attaches to the butt, the head's rotation point should be where the neck meets the body, etc).


I'll see if I can adjust your model for you...


Yes, regarding the flicker, like I said in my tutorial, one reason to not make a child is if you need a transformation (in this case a bit of scaling) on the part between part renders.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I tried that.  Maybe I did the math wrong.  I'll give it another shot.


Don't do too much on it, one tooth would be more than enough of an example.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

I tried that.  Maybe I did the math wrong.  I'll give it another shot.


Don't do too much on it, one tooth would be more than enough of an example.


Hey, I loaded the model and it looks really cool.  I really like it.


I'll try to show a tooth as an added box, and maybe an arm as a child.  Give me a few minutes.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I tried that.  Maybe I did the math wrong.


I'm still going through it. 


Starting with an easy one: making headb a child of head. All I had to do was:


1. modify the headb creation as follows:


        headb = new ModelRenderer(this, 40, 0);
        headb.addBox(-3F, -9F, -3F, 6, 1, 6);
        headb.setRotationPoint([b][color=blue]0F, 0F, 0F[/color][/b]);
        headb.setTextureSize(64, 32);
        headb.mirror = true;
        setRotation(headb, 0F, 0F, 0F);

Since headb should have the same rotation point as head, the setRotationPoint needs to be 0, 0, 0 (relative).  And I've made headb the child of head -- note make sure you use addChild() the right way around (some people think that they add head to headb as the method name is a bit ambiguous).


2. remove the separate render for headb.  rendering head should be sufficient to also see headb.


3. make sure you remove the separate rotations for headb.  Remove these lines:


        // Head        
        headb.rotateAngleX = head.rotateAngleX;
        headb.rotateAngleY = head.rotateAngleY;
        headb.rotateAngleZ = head.rotateAngleZ;


Try that and see if it works for you.


Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Still going.  Since you want to control flicker on the lower jaw, I left headlowera independent, but added headlowerb and tounge as children.  Again the rotation points are zeroed out, renders removed and rotations removed. 


Note that the rotations are also relative so you have to subtract them out.  So I left headlowera rotated, but headlowerb and tongue have no rotation (they'll rotate along with headlowera).


Now I'm working on the teeth.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

The "got it working" refers to the child setup, thanks to jabelar.



Still have the issue with the tail not flashing.


Regarding the tail not flashing, I'm not sure if it is related but for all the ModelRenderers you've set the texture size to 64 x 32 (I think you just kept the Techne Java line, which seems to mistakenly not put in the textureWidth and textureHeight variables).  I don't know if it is related to the flashing, but seems like it could be a problem (I'm assuming your texture is actually 256 x 256 right?


I'm actually crawling through your model as well, mostly for fun.  You have sooo many teeth!


Overall, I've got more suggestions to help you keep your sanity.  First of all, I suggest working in degrees instead of radians.  I usually use the following helper functions:


    protected float degToRad(float degrees)
        return degrees * (float)Math.PI / 180 ;
    protected void setRotation(ModelRenderer model, float rotX, float rotY, float rotZ)
        model.rotateAngleX = degToRad(rotX);
        model.rotateAngleY = degToRad(rotY);
        model.rotateAngleZ = degToRad(rotZ);        


You'll then have to go back to your setRotation calls and change the passed parameters to degrees, but frankly putting in 45F is a lot easier on the brain than 0.785398163F.  I did a quick pass through your model and it didn't take long to convert to degrees.


Secondly, for animation purposes later I think you need to adjust some rotation points.  Because you had previously not used children, you had a lot of the rotation points at the same place, but that isn't really correct.  You really want the rotation point to be the joint of the animation (i.e. any rotation).  So the head and jaw and neck and teeth shouldn't really have the same rotation point.  The neck should have rotation point where it attaches to the body, the head at the point where it attaches to the neck, the jaw where it attaches to the head and the teeth where they attach to the jaw.  You got away with it because offsets can make it look correct, but it really won't be when you get into animating.


For all these suggestions it will take some work to crawl through the model to correct it, but I think it will really help you later on.  But up to you.  For fun I'm going to continue to rework it a bit and I'll pass you the results.


You've also got me thinking about the render flicker thing.  It is a really bummer if you have to break the hierarchy just to do the 0.995 scaling trick, so I'm thinking about seeing if I can create my own extension to ModelRenderer that allows a scaling factor to be passed to it.  If the ModelRenderer is aware of the scaling factor, then even the children could render properly as the children are just a recursive call to the render() after doing the parent transformations.  Anyways, that would really be perfect if I can figure that out.


Again, I find this stuff fun.  Don't worry, I won't steal your model or anything, but I'll pass you any other thoughts as I come across them.



Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I don't mind if folks use it.


Its a rather complicated Raptor.  My two boys wanted one, so I inserted it into my multidimension mod.


Changed the texture size but no difference.


I did notice that there is a color change in a thin line going down the top of the tail.  Its doing the flash on a small portion of that tail.  Very Very weird.  It was doing this before the texture size change too.


Getting everything converted to child first, then I'll add the degree change.


BTW, only had to do lowerheada seperately.  All the teeth and lower jaw can tie to it.  if they are slightly scaled for the shimmer, doesn't really matter.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Ok, this is really wierd.  The Y and Z rotations on a child swap.  Easy to adjust, but haven't followed it out to see why.


I think it is because you actual made the body upright then tilted it down 75 degrees.  The Y and Z of the children will be relative, so if you tilt parent by 90 it will seem like a swap.


I think you actually did it the right way though for a dinosaur because it is still technically a bipedal creature and the head is "on top" even though it is visually more "in front" after the body is tilted.  To keep sane (my primary motivation when doing this 3D modeling stuff) you may want to only set the final rotations at the end after everything is connected and properly hierarchical.  Just zero out that setRotation when you create the body for now and you'll see what I mean.


It is cool that you said you did the dinosaur for your boys -- that's pretty much why I do mods too (my kids ask me to).


Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I just finished it.  Everything looks good and it is much easier to reason through.  I added your angle to radian method.  Sanity improved.  I'll post it tomorrow after some polishing.


One last question, have you figured out a good way to calculate the Y of translatef when you scale the model?


For example, I shrunk it in half and the y shift was 1.5.  I shrunk it by a factor of 4 and the y shift was 10.5.  I played around a little trying to curvefit it, but didn't get anything I liked so far.


Got to add the breading functionality now.  It will be one of those things where depending on luck and the quality of the parents, the quality of the child can improve an be a faster mount with a cooler skin.  THROW IN A SHEEP!!


This is rather scary and sorta sick, but I made it to where they get happy to breed after munching on another live animal.  Also made it so they mature based upon eating a live animal.  Custom sound track for ambient, hurt, and munching.


I've heard the boys scream a couple times when they attack.  When one agroes it sends out a help call, so rarely do you get one raptor, normally 10.



Anyone that is watching for the flashing tail, still an issue.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

One last question, have you figured out a good way to calculate the Y of translatef when you scale the model?


No, I admit that is a peeve of mine but have been too lazy to work it out once and for all.  When I don't have a closed form solution I usually do it brute force -- find all the pairs of translations and scales and just use them together.  Actually, if you record a few of those pairs you'll probably figure out the formula since it's gotta be linear.


I'm heading to bed.  Glad I was able to help.  If your model gets set up properly, it makes it really easy to do "amazing" animations.  Twitch the tail, have the body heave up and down with breathing, tilt the head for a dramatic look.  Have fun!

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Ok, check this out. 


I'm not GL expert, I normally have to check on web and infer some things. 


Based on reading and inferring, I "think" that 'GL11.glCallList(this.displayList);' actually throws the image up.  Correct me if I'm wrong.


I created the custom modelrender we talked about.  Once you initialize it, you can set its scale with MyScale(float MyScaleX, float MyScaleY, float MyScaleZ).


It won't translate to its children as I wrote it since were just trying to shrink one item to avoid that nasty ripple effect.


Also, I wrote this on Notepad++ and didn't get a chance to test it or anything (not at my home PC).




public class MyModelRenderer extends ModelRenderer {


// Setup Variables

protected float MyScaleX = 1;

protected float MyScaleY = 1;

protected float MyScaleZ = 1;


public ModelRenderer(ModelBase par1ModelBase, String par2Str) {

super(par1ModelBase, par2Str)




public void MyScale(float MyScaleX, float MyScaleY, float MyScaleZ) {


// Set Variables

this.MyScaleX = MyScaleX;

this.MyScaleY = MyScaleY;

this.MyScaleZ = MyScaleZ;





protected void customCallList() {


// Scale the render

GL11.glScalef(1 * MyScaleX, 1 * MyScaleY, 1 * MyScaleZ);


// Make the display call



// Remove the scale

GL11.glScalef(1 / MyScaleX, 1 / MyScaleY, 1 / MyScaleZ);






    public void render(float par1)


        if (!this.isHidden)


            if (this.showModel)


                if (!this.compiled)





                GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);

                int i;


                if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F)


                    if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F)





                        if (this.childModels != null)


                            for (i = 0; i < this.childModels.size(); ++i)








                        GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);




                        if (this.childModels != null)


                            for (i = 0; i < this.childModels.size(); ++i)






                        GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1, -this.rotationPointZ * par1);






                    GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);


                    if (this.rotateAngleZ != 0.0F)


                        GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);



                    if (this.rotateAngleY != 0.0F)


                        GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);



                    if (this.rotateAngleX != 0.0F)


                        GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);






                    if (this.childModels != null)


                        for (i = 0; i < this.childModels.size(); ++i)









                GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ);







    public void renderWithRotation(float par1)


        if (!this.isHidden)


            if (this.showModel)


                if (!this.compiled)






                GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);


                if (this.rotateAngleY != 0.0F)


                    GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);



                if (this.rotateAngleX != 0.0F)


                    GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);



                if (this.rotateAngleZ != 0.0F)


                    GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);













Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.