Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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:

  • Author

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.