本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.glVertex3f方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.glVertex3f方法的具体用法?Java GlStateManager.glVertex3f怎么用?Java GlStateManager.glVertex3f使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.glVertex3f方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderDefaultChar
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Render a single character with the default.png font at current (posX,posY) location...
*/
private float renderDefaultChar(int ch, boolean italic)
{
int i = ch % 16 * 8;
int j = ch / 16 * 8;
int k = italic ? 1 : 0;
this.bindTexture(this.locationFontTexture);
float f = this.charWidthFloat[ch];
float f1 = 7.99F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f((float)i / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f((float)i / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + f1 - 1.0F + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX + f1 - 1.0F - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return f;
}
示例2: renderDefaultChar
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Render a single character with the default.png font at current (posX,posY) location...
*/
protected float renderDefaultChar(int ch, boolean italic)
{
int i = ch % 16 * 8;
int j = ch / 16 * 8;
int k = italic ? 1 : 0;
bindTexture(this.locationFontTexture);
int l = this.charWidth[ch];
float f = (float)l - 0.01F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f((float)i / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f((float)i / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f - 1.0F) / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + f - 1.0F + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f - 1.0F) / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX + f - 1.0F - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return (float)l;
}
示例3: renderUnicodeChar
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files...
*/
private float renderUnicodeChar(char ch, boolean italic)
{
int i = this.glyphWidth[ch] & 255;
if (i == 0)
{
return 0.0F;
}
else
{
int j = ch / 256;
this.loadGlyphTexture(j);
int k = i >>> 4;
int l = i & 15;
float f = (float)k;
float f1 = (float)(l + 1);
float f2 = (float)(ch % 16 * 16) + f;
float f3 = (float)((ch & 255) / 16 * 16);
float f4 = f1 - f - 0.02F;
float f5 = italic ? 1.0F : 0.0F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f(f2 / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f(f2 / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return (f1 - f) / 2.0F + 1.0F;
}
}
示例4: renderUnicodeChar
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files...
*/
protected float renderUnicodeChar(char ch, boolean italic)
{
int i = this.glyphWidth[ch] & 255;
if (i == 0)
{
return 0.0F;
}
else
{
int j = ch / 256;
this.loadGlyphTexture(j);
int k = i >>> 4;
int l = i & 15;
float f = (float)k;
float f1 = (float)(l + 1);
float f2 = (float)(ch % 16 * 16) + f;
float f3 = (float)((ch & 255) / 16 * 16);
float f4 = f1 - f - 0.02F;
float f5 = italic ? 1.0F : 0.0F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f(f2 / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f(f2 / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return (f1 - f) / 2.0F + 1.0F;
}
}