Hello all,
I've been having trouble rendering an entity in forge, and I'm not quite sure what the problem is.
I have it rendering 2 faces of a cube, but whenever i look at a certain angle the cube disappears. It seems that it is only visible from the orientation 102(west) through -152(north)
here is the code inside of my "Render" file
package over.extrashapes;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.util.Icon;
import net.minecraft.util.ResourceLocation;
public class ShapeRender extends Render {
ResourceLocation texture = null;
public ShapeRender ()
{
}
@Override
public void doRender(Entity entity, double par2, double par4, double par6,float f, float f1) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
//GL11.glEnable(GL11.GL_BLEND);
// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
//GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(GL11.GL_QUADS);
tessellator.setColorRGBA(0, 0, 0, 128);
tessellator.setNormal(0, 0, 0);
//front
tessellator.addVertex(0, 0, 0);
tessellator.addVertex(0, 1, 0);
tessellator.addVertex(1, 1, 0);
tessellator.addVertex(1, 0, 0);
//back
tessellator.addVertex(1, 0, 1);
tessellator.addVertex(1, 1, 1);
tessellator.addVertex(0, 1, 1);
tessellator.addVertex(0, 0, 1);
tessellator.draw();
GL11.glPopMatrix();
// GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
// TODO Auto-generated method stub
return null;
}
}
any suggestions or solutions would be awesome, this has been haunting me for a couple days
Thanks