本文整理汇总了Java中org.lwjgl.opengl.GL11.glNormal3f方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glNormal3f方法的具体用法?Java GL11.glNormal3f怎么用?Java GL11.glNormal3f使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glNormal3f方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderTieRear
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private static final void renderTieRear(float width){
GL11.glTexCoord2f(tieSideMinU, tieSideMinV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(width/2, height, -length/2);
GL11.glTexCoord2f(tieSideMinU, tieSideMaxV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(width/2, 0, -length/2);
GL11.glTexCoord2f(tieSideMaxU, tieSideMaxV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(-width/2, 0, -length/2);
GL11.glTexCoord2f(tieSideMaxU, tieSideMinV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(-width/2, height, -length/2);
}
示例2: renderTieLeft
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private static final void renderTieLeft(float width){
GL11.glTexCoord2f(tieEndMinU, tieEndMinV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(-width/2, height, -length/2);
GL11.glTexCoord2f(tieEndMinU, tieEndMaxV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(-width/2, 0, -length/2);
GL11.glTexCoord2f(tieEndMaxU, tieEndMaxV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(-width/2, 0, length/2);
GL11.glTexCoord2f(tieEndMaxU, tieEndMinV);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3f(-width/2, height, length/2);
}
示例3: renderTileEntityAt
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntityPictureFrameMultiple frame, double x, double y, double z,
float partialTicks, int destroyStage) {
if (frame.shouldrender) {
// 1:normal 2:failtoload 3:loding
int rendertype = 0;
if (frame.istextureLoaded()) {
if (frame.textureID != -1) {
rendertype = 1;
}
} else {
if (frame.hasImageName()) {
if (frame.canLoadImage()) {
frame.loadImage();
}
if (frame.isFailed()) {
rendertype = 2;
} else {
rendertype = 3;
}
}
}
//render
if (rendertype > 0) {
boolean flippedX = false;
boolean flippedY = false;
GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GlStateManager.disableLighting();
GlStateManager.color(1, 1, 1, 1);
switch (rendertype) {
case 1:
GlStateManager.bindTexture(frame.textureID);
break;
case 2:
Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.FailToLoadImage);
break;
case 3:
Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.LODINGIMAGE);
break;
default:
return;
}
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GlStateManager.pushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
EnumFacing direction = EnumFacing.getFront(frame.getBlockMetadata() & 3);
EnumStateType stateType = EnumStateType.HANDGING;
applyDirection(direction);
GlStateManager.enableRescaleNormal();
GL11.glTranslated(0, (frame.height - 1) * 0.5, (frame.width - 1) * -0.5);
GL11.glScaled(1, frame.height - 0.4, frame.width - 0.4);
GL11.glTranslated(-0.93, 0, 0);
GL11.glBegin(GL11.GL_POLYGON);
GL11.glNormal3f(1.0f, 0.0F, 0.0f);
GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 0 : 1, 0);
GL11.glVertex3f(0.5F, -0.5f, -0.5f);
GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 1 : 0, 0);
GL11.glVertex3f(0.5f, 0.5f, -0.5f);
GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 1 : 0, 0);
GL11.glVertex3f(0.5f, 0.5f, 0.5f);
GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 0 : 1, 0);
GL11.glVertex3f(0.5f, -0.5f, 0.5f);
GL11.glEnd();
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
GlStateManager.enableLighting();
}
}
}
示例4: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(EntityProjectileHardStone 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();
}
示例5: renderName
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected void renderName(EntityPlayer entityplayer, double d, double d1, double d2)
{
if(Minecraft.isGuiEnabled() && entityplayer != renderManager.livingPlayer)
{
float f = 1.6F;
float f1 = 0.01666667F * f;
float f2 = entityplayer.getDistanceToEntity(renderManager.livingPlayer);
float f3 = entityplayer.isSneaking() ? 32F : 64F;
if(f2 < f3)
{
String s = entityplayer.username;
if(!entityplayer.isSneaking())
{
if(entityplayer.isPlayerSleeping())
{
renderLivingLabel(entityplayer, s, d, d1 - 1.5D, d2, 64);
} else
{
renderLivingLabel(entityplayer, s, d, d1, d2, 64);
}
} else
{
FontRenderer fontrenderer = getFontRendererFromRenderManager();
GL11.glPushMatrix();
GL11.glTranslatef((float)d + 0.0F, (float)d1 + 2.3F, (float)d2);
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GL11.glScalef(-f1, -f1, f1);
GL11.glDisable(2896 /*GL_LIGHTING*/);
GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F);
GL11.glDepthMask(false);
GL11.glEnable(3042 /*GL_BLEND*/);
GL11.glBlendFunc(770, 771);
Tessellator tessellator = Tessellator.instance;
GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
tessellator.startDrawingQuads();
int i = fontrenderer.getStringWidth(s) / 2;
tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
tessellator.addVertex(-i - 1, -1D, 0.0D);
tessellator.addVertex(-i - 1, 8D, 0.0D);
tessellator.addVertex(i + 1, 8D, 0.0D);
tessellator.addVertex(i + 1, -1D, 0.0D);
tessellator.draw();
GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
GL11.glDepthMask(true);
fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 0x20ffffff);
GL11.glEnable(2896 /*GL_LIGHTING*/);
GL11.glDisable(3042 /*GL_BLEND*/);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}
}
}
}
示例6: drawRailSegment
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Draws a rail segment with the given coordinates.
*
* @param texPoints
* @param w1 - X-coordinate of first vertex.
* @param w2 - X-coordinate of second vertex.
* @param h1 - Y-coordinate of first vertex.
* @param h2 - Y-coordinate of second vertex.
* @param t1 - Y-texture offset of first vertex.
* @param texScale - {@link openflextrack.api.IRailType#getTextureScale() Texture scale} of the rail segment.
* @param holographic - {@code true} if the track is holographic.
*/
private static void drawRailSegment(List<float[]> texPoints, float w1, float w2, float h1, float h2, float t1, float texScale, boolean holographic) {
/* Backup face mode. */
final int glFaceMode = GL11.glGetInteger(GL11.GL_FRONT_FACE);
final float t2 = t1 + (Math.abs(w2-w1) + Math.abs(h2-h1)) * texScale;
for (byte b = 1; b > -2; b-=2)
{
GL11.glPushMatrix();
/* If we're rendering the second rail, invert front face mode and scale.
* This will mirror the rail without the need to render vertices in different order. */
if (b == -1) {
if (glFaceMode == GL11.GL_CCW) {
GL11.glFrontFace(GL11.GL_CW);
}
else {
GL11.glFrontFace(GL11.GL_CCW);
}
}
/* Actually render the rail. */
GL11.glBegin(GL11.GL_QUAD_STRIP);
{
for (float[] point : texPoints) {
if (!holographic) {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, point[6]%65536, point[6]/65536);
}
GL11.glTexCoord2d(point[5], t2);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3d(point[0] + b*w1*point[4], point[1] + h1, point[2] + b*w1*point[3]);
GL11.glTexCoord2d(point[5], t1);
GL11.glNormal3f(0, 1, 0);
GL11.glVertex3d(point[0] + b*w2*point[4], point[1] + h2, point[2] + b*w2*point[3]);
}
}
GL11.glEnd();
GL11.glPopMatrix();
}
/* Reset face mode. */
GL11.glFrontFace(glFaceMode);
}
示例7: renderName
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected void renderName(EntityItemFrame entity, double x, double y, double z)
{
if (Minecraft.isGuiEnabled() && entity.getDisplayedItem() != null && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity)
{
float f = 1.6F;
float f1 = 0.016666668F * f;
double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
float f2 = entity.isSneaking() ? 32.0F : 64.0F;
if (d0 < (double)(f2 * f2))
{
String s = entity.getDisplayedItem().getDisplayName();
if (entity.isSneaking())
{
FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
GlStateManager.pushMatrix();
GlStateManager.translate((float)x + 0.0F, (float)y + entity.height + 0.5F, (float)z);
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(-f1, -f1, f1);
GlStateManager.disableLighting();
GlStateManager.translate(0.0F, 0.25F / f1, 0.0F);
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
int i = fontrenderer.getStringWidth(s) / 2;
GlStateManager.disableTexture2D();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos((double)(-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double)(-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double)(i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double)(i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.depthMask(true);
fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
else
{
this.renderLivingLabel(entity, s, x, y, z, 64);
}
}
}
}
示例8: renderTag
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderTag(Entity entity, double x, double y, double z) {
String name = entity.getName();
if(Wrapper.getFriends().isFriend(name)) {
name = "\2479" + name;
}
if (entity instanceof EntityLivingBase) {
name = name + " \247a" + ((double)Math.round((((EntityLivingBase) entity).getHealth() * 100) / 100) / 2);
}
for(Friend friend: Wrapper.getFriends().friendsList) {
name.replace(friend.getName(), friend.getAlias());
}
float var13 = 1.6F;
float var14 = (float) (0.016666668F * (Wrapper.getPlayer().getDistanceToEntity(entity)) / 2);
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) y + entity.height + 0.5F, (float) z);
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
GL11.glRotatef(-RenderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(RenderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GL11.glScalef(-var14, -var14, var14);
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_LIGHTING);
Tessellator var15 = Tessellator.getInstance();
VertexBuffer vertexbuffer = var15.getBuffer();
int var16 = (int) -Wrapper.getPlayer().getDistanceToEntity(entity) / (int) var13;
if (entity.isSneaking()) {
var16 += 4;
} else if (var16 < -14) {
var16 = -14;
}
GL11.glDisable(GL11.GL_TEXTURE_2D);
int var17 = Fonts.roboto18.getStringWidth(name) / 2;
RenderUtils.drawBorderedRect(-var17 - 2, var16, var17 + 2, 11 + var16, 0.5F, 0xFF000000, 0x80000000);
Fonts.roboto18.drawStringWithShadow(name, -var17, var16, 0xFFFFFF);
Wrapper.getMinecraft().entityRenderer.disableLightmap();
GL11.glLineWidth(1.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
示例9: renderItemMap
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderItemMap(AbstractClientPlayer clientPlayer, float p_178097_2_, float p_178097_3_, float p_178097_4_)
{
float f = -0.4F * MathHelper.sin(MathHelper.sqrt_float(p_178097_4_) * (float)Math.PI);
float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt_float(p_178097_4_) * (float)Math.PI * 2.0F);
float f2 = -0.2F * MathHelper.sin(p_178097_4_ * (float)Math.PI);
GlStateManager.translate(f, f1, f2);
float f3 = this.func_178100_c(p_178097_2_);
GlStateManager.translate(0.0F, 0.04F, -0.72F);
GlStateManager.translate(0.0F, p_178097_3_ * -1.2F, 0.0F);
GlStateManager.translate(0.0F, f3 * -0.5F, 0.0F);
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f3 * -85.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(0.0F, 1.0F, 0.0F, 0.0F);
this.renderPlayerArms(clientPlayer);
float f4 = MathHelper.sin(p_178097_4_ * p_178097_4_ * (float)Math.PI);
float f5 = MathHelper.sin(MathHelper.sqrt_float(p_178097_4_) * (float)Math.PI);
GlStateManager.rotate(f4 * -20.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f5 * -20.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(f5 * -80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(0.38F, 0.38F, 0.38F);
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(0.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(-1.0F, -1.0F, 0.0F);
GlStateManager.scale(0.015625F, 0.015625F, 0.015625F);
this.mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
GL11.glNormal3f(0.0F, 0.0F, -1.0F);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-7.0D, 135.0D, 0.0D).tex(0.0D, 1.0D).endVertex();
worldrenderer.pos(135.0D, 135.0D, 0.0D).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos(135.0D, -7.0D, 0.0D).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos(-7.0D, -7.0D, 0.0D).tex(0.0D, 0.0D).endVertex();
tessellator.draw();
MapData mapdata = Items.filled_map.getMapData(this.itemToRender, this.mc.theWorld);
if (mapdata != null)
{
this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, false);
}
}
示例10: renderLivingLabel
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Renders an entity's name above its head
*/
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance) {
if (entityIn instanceof EntityOtherPlayerMP) {
EventNameTags e = new EventNameTags();
e.call();
if (e.isCancelled())
return;
}
double d0 = entityIn.getDistanceSqToEntity(this.renderManager.livingPlayer);
if (d0 <= (double) (maxDistance * maxDistance)) {
FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
float f = 1.6F;
float f1 = 0.016666668F * f;
GlStateManager.pushMatrix();
GlStateManager.translate((float) x + 0.0F, (float) y + entityIn.height + 0.5F, (float) z);
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(-f1, -f1, f1);
GlStateManager.disableLighting();
GlStateManager.depthMask(false);
GlStateManager.disableDepth();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
int i = 0;
if (str.equals("deadmau5")) {
i = -10;
}
int j = fontrenderer.getStringWidth(str) / 2;
GlStateManager.disableTexture2D();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos((double) (-j - 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (-j - 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (j + 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (j + 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, 553648127);
GlStateManager.enableDepth();
GlStateManager.depthMask(true);
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, -1);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
}
示例11: doRender_PredictiveArrow
import org.lwjgl.opengl.GL11; //导入方法依赖的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();
}
示例12: glNormal3f
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glNormal3f(float nx, float ny, float nz)
{
GL11.glNormal3f(nx, ny, nz);
}
示例13: doRender
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(EntityArrow entity, double x, double y, double z, float entityYaw, float partialTicks)
{
this.bindEntityTexture(entity);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
int i = 0;
float f = 0.0F;
float f1 = 0.5F;
float f2 = (float)(0 + i * 10) / 32.0F;
float f3 = (float)(5 + i * 10) / 32.0F;
float f4 = 0.0F;
float f5 = 0.15625F;
float f6 = (float)(5 + i * 10) / 32.0F;
float f7 = (float)(10 + i * 10) / 32.0F;
float f8 = 0.05625F;
GlStateManager.enableRescaleNormal();
float f9 = (float)entity.arrowShake - partialTicks;
if (f9 > 0.0F)
{
float f10 = -MathHelper.sin(f9 * 3.0F) * f9;
GlStateManager.rotate(f10, 0.0F, 0.0F, 1.0F);
}
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(f8, f8, f8);
GlStateManager.translate(-4.0F, 0.0F, 0.0F);
GL11.glNormal3f(f8, 0.0F, 0.0F);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f6).endVertex();
worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f6).endVertex();
worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f7).endVertex();
worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f7).endVertex();
tessellator.draw();
GL11.glNormal3f(-f8, 0.0F, 0.0F);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f6).endVertex();
worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f6).endVertex();
worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f7).endVertex();
worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f7).endVertex();
tessellator.draw();
for (int j = 0; j < 4; ++j)
{
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, f8);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-8.0D, -2.0D, 0.0D).tex((double)f, (double)f2).endVertex();
worldrenderer.pos(8.0D, -2.0D, 0.0D).tex((double)f1, (double)f2).endVertex();
worldrenderer.pos(8.0D, 2.0D, 0.0D).tex((double)f1, (double)f3).endVertex();
worldrenderer.pos(-8.0D, 2.0D, 0.0D).tex((double)f, (double)f3).endVertex();
tessellator.draw();
}
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例14: normal
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void normal(float x, float y, float z) {
GL11.glNormal3f(x, y, z);
}
示例15: doRender
import org.lwjgl.opengl.GL11; //导入方法依赖的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();
}