Jump to content

Recommended Posts

Posted (edited)

Hi all, I am trying to create a custom model for my entity. I am trying to load an obj model. I know I need to use the OBJLoader class during model registration but I cant seem to find a consistent way to do this as it seems to vary between entity types. So far I have a class extending the EntityModel and my entity as a generic. I assume this can then be put into a mob renderer but, again I'm not sure and I just seem to be getting lots of errors.

I'm using the latest stable release 36.1.0.

Any help would be greatly appreciated. 

Edited by henzo800
EDIT: Clarified
Posted (edited)

Thanks for your quick reply spiritfilled. 

However, I'm still not sure how to load an OBJ model. My entity seems to be rendering Minecraft's included models just fine but I want to load an OBJ and MTL stored in the resources. Is there some way to convert an OBJ to parts. Although shouldn't I use the loader outlined in the forge doc's.

Here is my renderer and model so far.

public class CarEntityRender extends MobRenderer<CarEntity, CarModel> {
  
    public CarEntityRender(EntityRendererManager renderManagerIn) {
        super(renderManagerIn, new CarModel(), 1.0F);
    }
	@Override
	public ResourceLocation getTextureLocation(CarEntity p_110775_1_) {
		return new ResourceLocation(STAR.MODID, "textures/entity/red_rack.png");
	}
  
}
public class CarModel extends EntityModel<CarEntity>{

	@Override
	public void setupAnim(CarEntity p_225597_1_, float p_225597_2_, float p_225597_3_, float p_225597_4_,
			float p_225597_5_, float p_225597_6_) {
	}

	@Override
	public void renderToBuffer(MatrixStack p_225598_1_, IVertexBuilder p_225598_2_, int p_225598_3_, int p_225598_4_,
			float p_225598_5_, float p_225598_6_, float p_225598_7_, float p_225598_8_) {	
	}

}

Any help would be appreciated. 

Edited by henzo800
EDIT: Clarified

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.