Posted September 11, 201312 yr Hi, my model I imported is just black and not using my texture. Model package tattyseal.e.plane; import net.minecraft.client.model.ModelBase; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelPlane extends ModelBase { private IModelCustom modelTutBox; public ModelPlane() { modelTutBox = AdvancedModelLoader.loadModel("/assets/ee/models/Plane.obj"); } public void renderAll() { modelTutBox.renderAll(); } public void render(TilePlane box, double x, double y, double z) { // Push a blank matrix onto the stack GL11.glPushMatrix(); // Move the object into the correct position on the block (because the OBJ's origin is the center of the object) GL11.glTranslatef((float)x + 0.5f, (float)y + 1f, (float)z + 0.5f); // Scale our object to about half-size in all directions (the OBJ file is a little large) GL11.glScalef(0.25f, 0.25f, 0.25f); //GL11.gl // Bind the texture, so that OpenGL properly textures our block. FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "models/biplane.png")); // Render the object, using modelTutBox.renderAll(); this.renderAll(); // Pop this matrix from the stack. GL11.glPopMatrix(); } } Renderer package tattyseal.e.plane; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; public class TilePlaneRender extends TileEntitySpecialRenderer { private ModelPlane modelTutBox = new ModelPlane(); @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { modelTutBox.render((TilePlane)tileEntity, x, y, z); } }
September 12, 201312 yr I'm just taking a guess here. But should there be a leading slash in the file path for this line? // Bind the texture, so that OpenGL properly textures our block. FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "models/biplane.png")); Shouldn't it be this instead? // Bind the texture, so that OpenGL properly textures our block. FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "/models/biplane.png")); Like I said I know very little about OpenGL but its a guess. “Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds
September 12, 201312 yr I'm just taking a guess here. But should there be a leading slash in the file path for this line? // Bind the texture, so that OpenGL properly textures our block. FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "models/biplane.png")); Shouldn't it be this instead? // Bind the texture, so that OpenGL properly textures our block. FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "/models/biplane.png")); Like I said I know very little about OpenGL but its a guess. Umm.. I am sorry, but no. And also, that is MINECRAFT code not OpenGL code! ResourceLocations are just returning Icons in the end anyway I think... I am not entirely sure. But anyway. The extra slash is not needed. 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
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.