本文整理汇总了Java中net.minecraft.client.renderer.Tessellator.addVertex方法的典型用法代码示例。如果您正苦于以下问题:Java Tessellator.addVertex方法的具体用法?Java Tessellator.addVertex怎么用?Java Tessellator.addVertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.Tessellator
的用法示例。
在下文中一共展示了Tessellator.addVertex方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: renderQuad
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderQuad(Tessellator p_77017_1_, int p_77017_2_, int p_77017_3_, int p_77017_4_, int p_77017_5_, int p_77017_6_)
{
p_77017_1_.startDrawingQuads();
p_77017_1_.setColorOpaque_I(p_77017_6_);
p_77017_1_.addVertex((double)(p_77017_2_ + 0), (double)(p_77017_3_ + 0), 0.0D);
p_77017_1_.addVertex((double)(p_77017_2_ + 0), (double)(p_77017_3_ + p_77017_5_), 0.0D);
p_77017_1_.addVertex((double)(p_77017_2_ + p_77017_4_), (double)(p_77017_3_ + p_77017_5_), 0.0D);
p_77017_1_.addVertex((double)(p_77017_2_ + p_77017_4_), (double)(p_77017_3_ + 0), 0.0D);
p_77017_1_.draw();
}
示例4: drawCursorVertical
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
* draws the vertical line cursor in the textbox
*/
private void drawCursorVertical(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_)
{
int i1;
if (p_146188_1_ < p_146188_3_)
{
i1 = p_146188_1_;
p_146188_1_ = p_146188_3_;
p_146188_3_ = i1;
}
if (p_146188_2_ < p_146188_4_)
{
i1 = p_146188_2_;
p_146188_2_ = p_146188_4_;
p_146188_4_ = i1;
}
if (p_146188_3_ > this.xPosition + this.width)
{
p_146188_3_ = this.xPosition + this.width;
}
if (p_146188_1_ > this.xPosition + this.width)
{
p_146188_1_ = this.xPosition + this.width;
}
Tessellator tessellator = Tessellator.instance;
GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
GL11.glLogicOp(GL11.GL_OR_REVERSE);
tessellator.startDrawingQuads();
tessellator.addVertex((double)p_146188_1_, (double)p_146188_4_, 0.0D);
tessellator.addVertex((double)p_146188_3_, (double)p_146188_4_, 0.0D);
tessellator.addVertex((double)p_146188_3_, (double)p_146188_2_, 0.0D);
tessellator.addVertex((double)p_146188_1_, (double)p_146188_2_, 0.0D);
tessellator.draw();
GL11.glDisable(GL11.GL_COLOR_LOGIC_OP);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
示例5: 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();
}
示例6: 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();
}
示例7: SkyProviderTrappistOneC
import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public SkyProviderTrappistOneC()
{
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();
}
示例8: 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();
}
示例9: 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 EntityUpdraft)) {
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;
float r = entity.width / 2;
float h = entity.height;
GL11.glTranslated(0, - h / 2, 0);
GL11.glRotatef(entity.rotationYaw, 0.0F, 1.0F, 0.0F);
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(0F, -r, h);
tessellator.startDrawingQuads();
tessellator.addVertex(-r, h, r);
tessellator.addVertex(r, h, r);
tessellator.addVertex(0, 0, 0);
tessellator.addVertex(0, 0, 0);
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();
}