Jump to content

Rotation angle for model?


Fruitsalid
 Share

Recommended Posts

I made a custom model for an item just as a test and I can't figure out what rotation would make this correct.(http://imagebin.org/265693)

 

here's my render code:

public class RenderHammer implements IItemRenderer
{

protected ModelHammer hammerModel;

public RenderHammer()
{
	hammerModel = new ModelHammer();
}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
	switch(type)
	{
	case EQUIPPED: return true;
	case EQUIPPED_FIRST_PERSON: return true;
	default: return false;
	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
	return false;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
	switch(type)
	{
	case EQUIPPED:
	case EQUIPPED_FIRST_PERSON:
	{
		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.func_110577_a(new ResourceLocation("modclass","/textures/models/Hammer.png"));

		GL11.glRotatef(192F, 1.0F, 0.0F, 0.0F);
		GL11.glRotatef(95F, 0.0F, 1.0F, 0.0F);
		GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F);

		float scale = 1.6F;
		GL11.glScalef(scale, scale, scale);


		this.hammerModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

		GL11.glPopMatrix();
	}
		default: 
	}
}
}

Link to comment
Share on other sites

Unfortunately no one can give you the answer. When it comes to model rotation you have to play with it until it is how you want it...

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

it doesn't have to be a specific angle but how would a rotate it downwards, all the other ones just seem to turn it left or right

 

So you are wanting it to (say you are looking at the side) go from vertical, to 45˚?

 

 

example:

 

| to /

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

As others have said, the best way to answer this kind of question is by experiment. Try changing each of the rotation angles a little bit, one axis at a time, and observe what happens. Once you've found the right axis, adjust the angle until you get the result you want.

 

Keep in mind that when you perform multiple rotations, the effect of later ones will depend on the earlier ones. You may find it less confusing to start with all angles zero.

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.

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

 Share



×
×
  • Create New...

Important Information

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