Jump to content

Recommended Posts

Posted

Hi everyone, quick request:

 

I've got a file which we'll call 'ExtendMob' and each EntityLiving gets turned into an ExtendMob object aside from the player. This all works fine, and so I'm trying to change the scaling of the mob's model. I know this can be achieved by all the new model stuff added by 1.8, but that's not what I need.

 

So after looking over the different vanilla files, trying to figure out how the GiantZombie scales, I found the variables 'width' and 'height'; after changing such in a quick experiment I learned that that only has an effect on the bounding box, not the actual model. And then I saw the GiantZombie class uses the 'setSize' method, but to me demise it was protected. Then I embarked on using reflection to invoke the method, and after finally getting it to work, I simply learned that it does the exact same thing as just changing width and height.

 

Is there any way of changing the mob's model scaling in the code, not the asset files?

 

Would I maybe need to do some GL11 wizardry?

Posted

As you partially discovered, the width, height and also the setSize() only affect the bounding box.

 

For scaling the model, you do that in your model file for the entity. In the render method that is called, you add a G11 scale operation.

 

Note though that you may have to do a translation before and after the scaling, otherwise the "feet" of the entity will go into the ground. Basically what you need to do is:

 

1) G11 translate downwards by the distance your origin of the model is above the ground.

2) G11 scale

3) G11 translate upwards by the distance from Step #1 times the amount you scaled the model.

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

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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