Posted October 11, 201312 yr Hello, I'm trying to bind a texture to a face of a obj model with UV Mapping (Blender). So, it works in Blender and i exported the model to an obj. In Minecraft i'm binding the texture like this: FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("brickcraft", "/textures/test.png")); But when i open Minecraft my block looks like this (what actually looks kinda cool ): http://i.imagebanana.com/img/enn8yv30/20131011_18.12.17.png[/img] It looks the same even if i don't bind a texture to it. The console doesn't say that it can't find the texture. I'm guessing i'm doing something wrong in Blender. Thanks in advance! ss7 You sir are a god damn hero.
October 11, 201312 yr When do you bind the texture? Right before you do the render call, or does it happen to be after it? Would be easy to clear up this if we could see the rendering file If you guys dont get it.. then well ya.. try harder...
October 11, 201312 yr Author Hello, Here is my rendering code: MODEL: public void Render(TileEntity par1Entity, double x, double y, double z) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("brickcraft", "/textures/test.png")); model.renderAll(); GL11.glPopMatrix(); } TESR: @Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { new TestModel().Render(tileentity, d0, d1, d2); } ss7 You sir are a god damn hero.
October 12, 201312 yr Author Hello, It doesn't work either. But why should i do this? I've done it like this in ALL of my Blocks and it worked in ALL of my Blocks. So why should i do this? My method is faster. ss7 You sir are a god damn hero.
October 12, 201312 yr Hi It looks to me like your object is rendering using the default block texture sheet instead of your new texture. Are you sure that your renderAll isn't rebinding the texture back to block perhaps? Perhaps you could test this by drawing a rectangle using the tessellator immediately after your bindTexture. If it works, at least you know your resource has been properly located. -TGG
October 12, 201312 yr Author Hello, I've tried to render a rectangle with the Tesselator but even that doesn't worked. Here is my code: Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x + 0, y + height, zLevel, 0,1); tessellator.addVertexWithUV(x + width, y + height, zLevel, 1, 1); tessellator.addVertexWithUV(x + width, y + 0, zLevel, 1,0); tessellator.addVertexWithUV(x + 0, y + 0, zLevel, 0, 0); tessellator.draw(); Maybe i'm doing something wrong there, because i'm new to rendering. ss7 You sir are a god damn hero.
October 12, 201312 yr Author Hello, When i bind no texture to it and try opening the GUI of my block and taking out the item that was in there, it's rendering another image. http://i.imagebanana.com/img/2vaf9tav/20131012_12.19.45.png[/img] When i bind a texture to it it looks like this: http://youtu.be/qT0IOXn5__E EDIT: OH MAN!!! That was just the wrong block that i was looking at! Sorry! This is now SOLVED ss7 You sir are a god damn hero.
October 12, 201312 yr Welcome to the world of programming, facepalm's are quite frequent when debugging, but hey that's the life of a programmer If you guys dont get it.. then well ya.. try harder...
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.