Posted November 1, 201410 yr I've been working on a wand like item for a little bit now. I have everything done accept the texture of the projectile it shoots. I've been trying and trying but nothing seems to work. I've been able to get it to shoot the wand itself like a projectile but I can't get it to work with my custom one. I don't want it 3D or anything. Here is my RenderWandBolt class: http://pastebin.com/MAq59FEY How do you do?
November 1, 201410 yr Your resource location is wrong, it is supposed to be private static final ResourceLocation texture = new ResourceLocation(MODID, "textures/entity/magic_Pro.png");
November 1, 201410 yr Author Your resource location is wrong, it is supposed to be private static final ResourceLocation texture = new ResourceLocation(MODID, "textures/entity/magic_Pro.png"); Did this and nothing changed : http://pastebin.com/KVPLDVxq How do you do?
November 1, 201410 yr Author I've been trying all I can, I'm really confused and I need help with this. How do you do?
November 1, 201410 yr Author Why are you using the U and V coordinates from an IIcon when you are drawing with your own texture? That makes no sense. I'm pretty new IIcon. What do the U and V coordinates and what can I do about them? How do you do?
November 1, 201410 yr Author U and V Coordinates are the X and Y coordinates in your Texture. You need to decide which part of your texture you want to draw. You don't need an IIcon here at all, since you are not trying to draw an Item or Block texture. So I removed all things IIcon from my render class, and then I put the internals func_77026_a into doRender(I don't know if your supposed to do that, when I removed the IIcon the entity wouldn't appear at all so I put it in doRender) and it appeared, but whenever I face a certain direction it would turn black, and the other directions it would be black. How do you do?
November 2, 201410 yr Author You need to specifiy U/V Coordinates when you are rendering with a texture. Use addVertexWithUV for that. I did this and it fixed the problem with the projectile turning black at certain angles. But I know little to none about tesselators(and OpenGL, in case its important right here), so when I added the arguments it told me to add, I didn't know what to put in there. here is the what I have in the tesselator float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, p4, p4); tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, p4, p4); tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, p4, p4); tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, p4, p4); tessellator.draw(); It added the two p4's at the end and I don't know what to replace that with. Also the consol was telling me that my texture path was wrong so I changed it from Constants.MODID, ":textures/entity/magic_Pro.png" to Constants.MODID, "textures/entity/magic_Pro.png" the texture path fixed and now the projectile blinks(flashes from purple to a darker purple, which are two colors of my projectile texture). Also thanks for spending your time helping me with this. How do you do?
November 3, 201410 yr Hi This link might help to understand Quad rendering and the Tessellator http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html -TGG
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.