Search in sources :

Example 36 with Tessellator

use of net.minecraft.client.renderer.Tessellator in project NetherEx by LogicTechCorp.

the class RenderGhastlingFireball method doRender.

@Override
public void doRender(EntityGhastlingFireball fireball, double x, double y, double z, float entityYaw, float partialTicks) {
    GlStateManager.pushMatrix();
    bindEntityTexture(fireball);
    GlStateManager.translate((float) x, (float) y, (float) z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(2.0F, 2.0F, 2.0F);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    GlStateManager.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate((float) (renderManager.options.thirdPersonView == 2 ? -1 : 1) * -renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    if (renderOutlines) {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(getTeamColor(fireball));
    }
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    vertexbuffer.pos(-0.5D, -0.25D, 0.0D).tex(0.0D, 1.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, -0.25D, 0.0D).tex(1.0D, 1.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, 0.75D, 0.0D).tex(1.0D, 0.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(-0.5D, 0.75D, 0.0D).tex(0.0D, 0.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    if (renderOutlines) {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(fireball, x, y, z, entityYaw, partialTicks);
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) VertexBuffer(net.minecraft.client.renderer.VertexBuffer)

Example 37 with Tessellator

use of net.minecraft.client.renderer.Tessellator in project NetherEx by LogicTechCorp.

the class RenderGhastQueenFireball method doRender.

@Override
public void doRender(EntityGhastQueenFireball fireball, double x, double y, double z, float entityYaw, float partialTicks) {
    GlStateManager.pushMatrix();
    bindEntityTexture(fireball);
    GlStateManager.translate((float) x, (float) y, (float) z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(2.0F, 2.0F, 2.0F);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    GlStateManager.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate((float) (renderManager.options.thirdPersonView == 2 ? -1 : 1) * -renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    if (renderOutlines) {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(getTeamColor(fireball));
    }
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    vertexbuffer.pos(-0.5D, -0.25D, 0.0D).tex(0.0D, 1.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, -0.25D, 0.0D).tex(1.0D, 1.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, 0.75D, 0.0D).tex(1.0D, 0.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(-0.5D, 0.75D, 0.0D).tex(0.0D, 0.0D).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    if (renderOutlines) {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(fireball, x, y, z, entityYaw, partialTicks);
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) VertexBuffer(net.minecraft.client.renderer.VertexBuffer)

Example 38 with Tessellator

use of net.minecraft.client.renderer.Tessellator in project NetherEx by LogicTechCorp.

the class RenderUtil method drawTexturedModalRect.

public static void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) {
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((double) (x + 0), (double) (y + height), 0.0D).tex((double) ((float) (textureX + 0) * 0.00390625F), (double) ((float) (textureY + height) * 0.00390625F)).endVertex();
    vertexbuffer.pos((double) (x + width), (double) (y + height), 0.0D).tex((double) ((float) (textureX + width) * 0.00390625F), (double) ((float) (textureY + height) * 0.00390625F)).endVertex();
    vertexbuffer.pos((double) (x + width), (double) (y + 0), 0.0D).tex((double) ((float) (textureX + width) * 0.00390625F), (double) ((float) (textureY + 0) * 0.00390625F)).endVertex();
    vertexbuffer.pos((double) (x + 0), (double) (y + 0), 0.0D).tex((double) ((float) (textureX + 0) * 0.00390625F), (double) ((float) (textureY + 0) * 0.00390625F)).endVertex();
    tessellator.draw();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) VertexBuffer(net.minecraft.client.renderer.VertexBuffer)

Example 39 with Tessellator

use of net.minecraft.client.renderer.Tessellator in project Trains-In-Motion-1.7.10 by EternalBlueFlame.

the class GUITransport method drawTexturedRect.

public static void drawTexturedRect(int posX, int posY, int posU, int posV, int width, int height) {
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(posX, posY + height, 0, posU * guiScaler, (posV + height) * guiScaler);
    tessellator.addVertexWithUV(posX + width, posY + height, 0, (posU + width) * guiScaler, (posV + height) * guiScaler);
    tessellator.addVertexWithUV(posX + width, posY, 0, (posU + width) * guiScaler, posV * guiScaler);
    tessellator.addVertexWithUV(posX, posY, 0, posU * guiScaler, posV * guiScaler);
    tessellator.draw();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator)

Example 40 with Tessellator

use of net.minecraft.client.renderer.Tessellator in project GregTech by GregTechCE.

the class TextureArea method draw.

@SideOnly(Side.CLIENT)
public void draw(int x, int y, int width, int height) {
    Minecraft.getMinecraft().renderEngine.bindTexture(imageLocation);
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder bufferbuilder = tessellator.getBuffer();
    bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
    bufferbuilder.pos(x, y + height, 0.0D).tex(offsetX, offsetY + imageHeight).endVertex();
    bufferbuilder.pos(x + width, y + height, 0.0D).tex(offsetX + imageWidth, offsetY + imageHeight).endVertex();
    bufferbuilder.pos(x + width, y, 0.0D).tex(offsetX + imageWidth, offsetY).endVertex();
    bufferbuilder.pos(x, y, 0.0D).tex(offsetX, offsetY).endVertex();
    tessellator.draw();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) BufferBuilder(net.minecraft.client.renderer.BufferBuilder) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

Tessellator (net.minecraft.client.renderer.Tessellator)618 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)290 WorldRenderer (net.minecraft.client.renderer.WorldRenderer)54 VertexBuffer (net.minecraft.client.renderer.VertexBuffer)42 BlockPos (net.minecraft.util.math.BlockPos)37 ResourceLocation (net.minecraft.util.ResourceLocation)31 Vec3d (net.minecraft.util.math.Vec3d)30 EnumFacing (net.minecraft.util.EnumFacing)24 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)23 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)19 IIcon (net.minecraft.util.IIcon)19 Random (java.util.Random)18 IBlockState (net.minecraft.block.state.IBlockState)17 Minecraft (net.minecraft.client.Minecraft)15 EntityPlayer (net.minecraft.entity.player.EntityPlayer)14 World (net.minecraft.world.World)14 Block (net.minecraft.block.Block)13 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)13 ArrayList (java.util.ArrayList)12 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)12