本文整理汇总了Java中net.minecraft.client.renderer.Tessellator.instance方法的典型用法代码示例。如果您正苦于以下问题:Java Tessellator.instance方法的具体用法?Java Tessellator.instance怎么用?Java Tessellator.instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.Tessellator
的用法示例。
在下文中一共展示了Tessellator.instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderCube
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderCube(RenderBlocks renderer, Block block, int meta) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
tessellator.draw();
}
示例2: renderIcon
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderIcon(IIcon icon) {
Tessellator tessellator = Tessellator.instance;
float minU = icon.getMinU();
float maxU = icon.getMaxU();
float minV = icon.getMinV();
float maxV = icon.getMaxV();
OpenGLHelper.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
OpenGLHelper.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV(-0.5F, -0.25F, 0.0D, minU, maxV);
tessellator.addVertexWithUV(0.5F, -0.25F, 0.0D, maxU, maxV);
tessellator.addVertexWithUV(0.5F, 0.75F, 0.0D, maxU, minV);
tessellator.addVertexWithUV(-0.5F, 0.75F, 0.0D, minU, minV);
tessellator.draw();
}
示例3: renderInventoryBlock
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public static void renderInventoryBlock(RenderBlocks renderblocks, Block block, Fluid fluid) {
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
示例4: drawGradientRect
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void drawGradientRect(int zLevel, int p_73733_1_, int p_73733_2_, int p_73733_3_, int p_73733_4_, int p_73733_5_, int p_73733_6_)
{
float f = (float) (p_73733_5_ >> 24 & 255) / 255.0F;
float f1 = (float) (p_73733_5_ >> 16 & 255) / 255.0F;
float f2 = (float) (p_73733_5_ >> 8 & 255) / 255.0F;
float f3 = (float) (p_73733_5_ & 255) / 255.0F;
float f4 = (float) (p_73733_6_ >> 24 & 255) / 255.0F;
float f5 = (float) (p_73733_6_ >> 16 & 255) / 255.0F;
float f6 = (float) (p_73733_6_ >> 8 & 255) / 255.0F;
float f7 = (float) (p_73733_6_ & 255) / 255.0F;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(f1, f2, f3, f);
tessellator.addVertex((double) p_73733_3_, (double) p_73733_2_, (double) zLevel);
tessellator.addVertex((double) p_73733_1_, (double) p_73733_2_, (double) zLevel);
tessellator.setColorRGBA_F(f5, f6, f7, f4);
tessellator.addVertex((double) p_73733_1_, (double) p_73733_4_, (double) zLevel);
tessellator.addVertex((double) p_73733_3_, (double) p_73733_4_, (double) zLevel);
tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
示例5: drawGradientRect
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6)
{
float f = (float)(par5 >> 24 & 255) / 255.0F;
float f1 = (float)(par5 >> 16 & 255) / 255.0F;
float f2 = (float)(par5 >> 8 & 255) / 255.0F;
float f3 = (float)(par5 & 255) / 255.0F;
float f4 = (float)(par6 >> 24 & 255) / 255.0F;
float f5 = (float)(par6 >> 16 & 255) / 255.0F;
float f6 = (float)(par6 >> 8 & 255) / 255.0F;
float f7 = (float)(par6 & 255) / 255.0F;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(f1, f2, f3, f);
tessellator.addVertex((double)par3, (double)par2, 0.0D);
tessellator.addVertex((double)par1, (double)par2, 0.0D);
tessellator.setColorRGBA_F(f5, f6, f7, f4);
tessellator.addVertex((double)par1, (double)par4, 0.0D);
tessellator.addVertex((double)par3, (double)par4, 0.0D);
tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
示例6: drawTexturedModalRectNormal
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void drawTexturedModalRectNormal(int x, int y, int width, int height) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(x , y + height, 0, 0.0, 1.0);
tessellator.addVertexWithUV(x + width, y + height, 0, 1.0, 1.0);
tessellator.addVertexWithUV(x + width, y , 0, 1.0, 0.0);
tessellator.addVertexWithUV(x , y , 0, 0.0, 0.0);
tessellator.draw();
}
示例7: doRender
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
if (!(entity instanceof EntityWindBlade)) {
return;
}
this.bindEntityTexture(entity);
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
//原点移到实体中心
GL11.glRotatef(entity.rotationYaw - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(entity.rotationPitch, 0.0F, 0.0F, 1.0F);
Tessellator tessellator = Tessellator.instance;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(1, 0.1f, 1);
for (int i = 0; i < 180; ++i)
{
GL11.glRotatef(1F, 1.0F, 0.0F, 0.0F);
//GL11.glNormal3f(0.0F, 0.0F, f10);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(-1D, -1D, 0.0D, 0, 1); // 左下
tessellator.addVertexWithUV( 1D, -1D, 0.0D, 0, 0); // 左上
tessellator.addVertexWithUV( 1D, 1D, 0.0D, 1, 0); // 右上
tessellator.addVertexWithUV(-1D, 1D, 0.0D, 1, 1); // 右下
tessellator.draw();
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
示例8: doRender_DefaultProjectile
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void doRender_DefaultProjectile(Entity par1Entity, double x, double y, double z, float yaw, float tick, double length, double width)
{
GL11.glPushMatrix();
this.bindEntityTexture(par1Entity);
GL11.glDisable(GL11.GL_LIGHTING); // For proper world lighting, not internal lighting. Otherwise the entity is too dark
GL11.glDisable(GL11.GL_CULL_FACE); // Disables the culling of back faces. Good for not having to draw front and back of a thing
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslatef((float)x, (float)y, (float)z);
GL11.glScalef(0.5F, 0.5F, 0.5F);
Tessellator tes = Tessellator.instance; // Grab a instance of the tesselator here (non-static, as they say)
GL11.glRotatef(par1Entity.prevRotationYaw + (par1Entity.rotationYaw - par1Entity.prevRotationYaw) * tick - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(par1Entity.prevRotationPitch + (par1Entity.rotationPitch - par1Entity.prevRotationPitch) * tick, 0.0F, 0.0F, 1.0F);
float f10 = 0.05625F;
GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
GL11.glScalef(f10, f10, f10);
GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
GL11.glNormal3f(f10, 0.0F, 0.0F);
for (int i = 0; i < 2; ++i)
{
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, f10);
tes.startDrawingQuads();
// X Y Z TX, TY
tes.addVertexWithUV(-length, -width, 0.0D, 0, 0);
tes.addVertexWithUV( length, -width, 0.0D, 0, 1);
tes.addVertexWithUV( length, width, 0.0D, 1, 1);
tes.addVertexWithUV(-length, width, 0.0D, 1, 0);
tes.draw();
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
示例9: drawScreen
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void drawScreen()
{
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator tessellator = Tessellator.instance;
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float f1 = 32.0F;
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(2105376);
tessellator.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, (double) ((float) this.left / f1), (double) ((float) this.bottom / f1));
tessellator.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, (double) ((float) this.right / f1), (double) ((float) this.bottom / f1));
tessellator.addVertexWithUV((double) this.right, (double) this.top, 0.0D, (double) ((float) this.right / f1), (double) ((float) this.top / f1));
tessellator.addVertexWithUV((double) this.left, (double) this.top, 0.0D, (double) ((float) this.left / f1), (double) ((float) this.top / f1));
tessellator.draw();
GL11.glDisable(GL11.GL_DEPTH_TEST);
byte b0 = 4;
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 0, 1);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_TEXTURE_2D);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_I(0, 0);
tessellator.addVertexWithUV((double) this.left, (double) (this.top + b0), 0.0D, 0.0D, 1.0D);
tessellator.addVertexWithUV((double) this.right, (double) (this.top + b0), 0.0D, 1.0D, 1.0D);
tessellator.setColorRGBA_I(0, 255);
tessellator.addVertexWithUV((double) this.right, (double) this.top, 0.0D, 1.0D, 0.0D);
tessellator.addVertexWithUV((double) this.left, (double) this.top, 0.0D, 0.0D, 0.0D);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorRGBA_I(0, 255);
tessellator.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, 0.0D, 1.0D);
tessellator.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, 1.0D, 1.0D);
tessellator.setColorRGBA_I(0, 0);
tessellator.addVertexWithUV((double) this.right, (double) (this.bottom - b0), 0.0D, 1.0D, 0.0D);
tessellator.addVertexWithUV((double) this.left, (double) (this.bottom - b0), 0.0D, 0.0D, 0.0D);
tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_BLEND);
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
int titleWidth = fontRenderer.getStringWidth(title);
fontRenderer.drawStringWithShadow(title, this.left + ((this.right - this.left) / 2) - (titleWidth / 2), this.top + 2, 0xFFFFFF);
int topStart = this.top + 15;
for (String line : lines)
{
if (centeredF)
{
int stringWidth = fontRenderer.getStringWidth(line);
fontRenderer.drawStringWithShadow(line, this.left + ((this.right - this.left) / 2) - (stringWidth / 2), topStart, 0xFFFFFF);
}
else
{
fontRenderer.drawStringWithShadow(line, this.left, topStart, 0xFFFFFF);
}
topStart += 10;
}
}
示例10: renderRod
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public static void renderRod(RenderBlocks renderer, Block block, int meta) {
Tessellator tessellator = Tessellator.instance;
double x = 7 / 16.0;
double y = 0;
double z = 7 / 16.0;
renderer.setRenderBounds(0, 1 / 16F, 0, 2 / 16F, 1, 2 / 16F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
tessellator.draw();
x = 4 / 16.0;
y = 0;
z = 4 / 16.0;
renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 6 / 16F, 1 / 16F, 6 / 16F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
y = -13 / 16.0;
renderer.setRenderBounds(2 / 16F, 13 / 16F, 2 / 16F, 6 / 16F, 14 / 16F, 6 / 16F);
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
tessellator.draw();
}
示例11: render
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void render(EntityProjectileSoftStone entity, double x, double y, double z, float par8, float par9)
{
bindEntityTexture(entity);
GL11.glPushMatrix();
GL11.glTranslatef((float)x, (float)y, (float)z);
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
Tessellator tessellator = Tessellator.instance;
float fx1 = 0.0F;
float fx2 = 8 / 32.0F;
float fy1 = 0.0F;
float fy2 = 8 / 32.0F;
float f10 = 0.05625F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
GL11.glScalef(f10, f10, f10);
GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
for (int i = 0; i < 2; ++i)
{
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, f10);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(-2.0D, -2.0D, 0.0D, fx1, fy1);
tessellator.addVertexWithUV(2.0D, -2.0D, 0.0D, fx2, fy1);
tessellator.addVertexWithUV(2.0D, 2.0D, 0.0D, fx2, fy2);
tessellator.addVertexWithUV(-2.0D, 2.0D, 0.0D, fx1, fy2);
tessellator.draw();
}
for (int i = 0; i < 2; ++i)
{
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, f10);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(0.0D, -2.0D, -2.0D, fx1, fy1);
tessellator.addVertexWithUV(0.0D, -2.0D, 2.0D, fx2, fy1);
tessellator.addVertexWithUV(0.0D, 2.0D, 2.0D, fx2, fy2);
tessellator.addVertexWithUV(0.0D, 2.0D, -2.0D, fx1, fy2);
tessellator.draw();
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
示例12: SkyProviderTrappistOneB
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public SkyProviderTrappistOneB()
{
int displayLists = GLAllocation.generateDisplayLists(3);
this.starList = displayLists;
this.glSkyList = displayLists + 1;
this.glSkyList2 = displayLists + 2;
// Bind stars to display list
GL11.glPushMatrix();
GL11.glNewList(this.starList, GL11.GL_COMPILE);
this.renderStars();
GL11.glEndList();
GL11.glPopMatrix();
final Tessellator tessellator = Tessellator.instance;
GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
final byte byte2 = 64;
final int i = 256 / byte2 + 2;
float f = 16F;
for (int j = -byte2 * i; j <= byte2 * i; j += byte2)
{
for (int l = -byte2 * i; l <= byte2 * i; l += byte2)
{
tessellator.startDrawingQuads();
tessellator.addVertex(j + 0, f, l + 0);
tessellator.addVertex(j + byte2, f, l + 0);
tessellator.addVertex(j + byte2, f, l + byte2);
tessellator.addVertex(j + 0, f, l + byte2);
tessellator.draw();
}
}
GL11.glEndList();
GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
f = -16F;
tessellator.startDrawingQuads();
for (int k = -byte2 * i; k <= byte2 * i; k += byte2)
{
for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2)
{
tessellator.addVertex(k + byte2, f, i1 + 0);
tessellator.addVertex(k + 0, f, i1 + 0);
tessellator.addVertex(k + 0, f, i1 + byte2);
tessellator.addVertex(k + byte2, f, i1 + byte2);
}
}
tessellator.draw();
GL11.glEndList();
}
示例13: renderStars
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderStars()
{
final Random rand = new Random(10842L);
final Tessellator var2 = Tessellator.instance;
var2.startDrawingQuads();
for (int starIndex = 0; starIndex < (ConfigManagerCore.moreStars ? 35000 : 6000); ++starIndex)
{
double var4 = rand.nextFloat() * 2.0F - 1.0F;
double var6 = rand.nextFloat() * 2.0F - 1.0F;
double var8 = rand.nextFloat() * 2.0F - 1.0F;
final double var10 = 0.15F + rand.nextFloat() * 0.1F;
double var12 = var4 * var4 + var6 * var6 + var8 * var8;
if (var12 < 1.0D && var12 > 0.01D)
{
var12 = 1.0D / Math.sqrt(var12);
var4 *= var12;
var6 *= var12;
var8 *= var12;
final double var14 = var4 * (ConfigManagerCore.moreStars ? rand.nextDouble() * 150D + 130D : 100.0D);
final double var16 = var6 * (ConfigManagerCore.moreStars ? rand.nextDouble() * 150D + 130D : 100.0D);
final double var18 = var8 * (ConfigManagerCore.moreStars ? rand.nextDouble() * 150D + 130D : 100.0D);
final double var20 = Math.atan2(var4, var8);
final double var22 = Math.sin(var20);
final double var24 = Math.cos(var20);
final double var26 = Math.atan2(Math.sqrt(var4 * var4 + var8 * var8), var6);
final double var28 = Math.sin(var26);
final double var30 = Math.cos(var26);
final double var32 = rand.nextDouble() * Math.PI * 2.0D;
final double var34 = Math.sin(var32);
final double var36 = Math.cos(var32);
for (int var38 = 0; var38 < 4; ++var38)
{
final double var39 = 0.0D;
final double var41 = ((var38 & 2) - 1) * var10;
final double var43 = ((var38 + 1 & 2) - 1) * var10;
final double var47 = var41 * var36 - var43 * var34;
final double var49 = var43 * var36 + var41 * var34;
final double var53 = var47 * var28 + var39 * var30;
final double var55 = var39 * var28 - var47 * var30;
final double var57 = var55 * var22 - var49 * var24;
final double var61 = var49 * var22 + var55 * var24;
var2.addVertex(var14 + var57, var16 + var53, var18 + var61);
}
}
}
var2.draw();
}
示例14: doRender_PredictiveArrow
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void doRender_PredictiveArrow(Entity par1EntityArrow, double par2, double par4, double par6, float par8, float par9)
{
this.bindEntityTexture(par1EntityArrow);
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
Tessellator tessellator = Tessellator.instance;
byte b0 = 0;
float f2 = 0.0F;
float f3 = 0.5F;
float f4 = (float)(0 + b0 * 10) / 32.0F;
float f5 = (float)(5 + b0 * 10) / 32.0F;
float f6 = 0.0F;
float f7 = 0.15625F;
float f8 = (float)(5 + b0 * 10) / 32.0F;
float f9 = (float)(10 + b0 * 10) / 32.0F;
float f10 = 0.05625F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
GL11.glScalef(f10, f10, f10);
GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
GL11.glNormal3f(f10, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);
tessellator.draw();
GL11.glNormal3f(-f10, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8);
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8);
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9);
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9);
tessellator.draw();
for (int i = 0; i < 4; ++i)
{
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, f10);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4);
tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4);
tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5);
tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5);
tessellator.draw();
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
示例15: doRender
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
@Override
public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
if (!(entity instanceof EntityExplosiveAirGun) && !(entity instanceof EntityBasicAirGun)) {
return;
}
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDepthMask(false);
Tessellator tessellator = Tessellator.instance;
double r = entity.width / 2;
GL11.glColor4f(0.5F, 0.5F, 0.5F, 0.5F);
for (int i = 0; i < 4; ++i) {
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, 1.0F);
tessellator.startDrawingQuads();
tessellator.addVertex( r, -r, r); // 右下
tessellator.addVertex( r, r, r); // 右上
tessellator.addVertex(-r, r, r); // 左上
tessellator.addVertex(-r, -r, r); // 左下
tessellator.draw();
}
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
for (int i = 0; i < 2; ++i) {
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, 1.0F);
tessellator.startDrawingQuads();
tessellator.addVertex( r, -r, r); // 右下
tessellator.addVertex( r, r, r); // 右上
tessellator.addVertex(-r, r, r); // 左上
tessellator.addVertex(-r, -r, r); // 左下
tessellator.draw();
}
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
}