Jump to content

[Solved][1.8.9] How do I apply a texture to entity that uses OBJLoader /OBJModel


techstack

Recommended Posts

Hello everyone,

I've had some success porting my mod to 1.8.9 but i'd like to take advantage of the new OBJLoaders for my entities. I've been able to work out how to load them & draw them on screen. But i haven't had any success in getting the textures to apply. (see screenshot)

 

I know of bindEntityTexture(entity) in the entity's rendered however it just resulted in an all black texture.

When i do not use bindEntityTexture(entity) i get the default purple & black texture.

 

Is there any documentation on how to use this new OBJLoader ? especially for entities..... my google-fu abilities have been weak on this topic so far.

 

 

 

 

Source for this branch /commit https://github.com/TechStack/TechStack-s-HeavyMachineryMod/tree/752b09b48fdd079ba5c74f7a5cc3f7a2d6e00853

 

Check the following for the model class code: https://github.com/TechStack/TechStack-s-HeavyMachineryMod/blob/752b09b48fdd079ba5c74f7a5cc3f7a2d6e00853/src/main/java/com/projectreddog/machinemod/model/ModelLawnmower.java

 

The Renderer 

https://github.com/TechStack/TechStack-s-HeavyMachineryMod/blob/752b09b48fdd079ba5c74f7a5cc3f7a2d6e00853/src/main/java/com/projectreddog/machinemod/render/machines/RenderLawnmower.java

 

 

lawnmower.mtl & lawnmower.obj can be found here :

https://github.com/TechStack/TechStack-s-HeavyMachineryMod/tree/752b09b48fdd079ba5c74f7a5cc3f7a2d6e00853/src/main/resources/assets/machinemod/models

 

 

 

 

 

Image of current state with purple & black default texture when bindtexture is disabled:

Link to comment
Share on other sites

Seems that the UV cords are off.

If i load the model with a different image (one that is 100% orange) the model is rendered orange when using

this.bindEntityTexture(entity);

 

 

Marking topic as solved as its unrelated to the subject.

If anyone else has info on the proper way to do this in 1.8.9 I'd love to hear it :D

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