当前位置: 首页>>代码示例>>Java>>正文


Java GL11.glScalef方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.GL11.glScalef方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glScalef方法的具体用法?Java GL11.glScalef怎么用?Java GL11.glScalef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.GL11的用法示例。


在下文中一共展示了GL11.glScalef方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(DefierTileEntity te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
	super.render(te, x, y, z, partialTicks, destroyStage, alpha);
	GL11.glPushMatrix();
	if(te.render_pulsate_increase){
		te.render_pulsate++;
		if(te.render_pulsate >= 100){
			te.render_pulsate_increase = false;
		}
	}else{
		te.render_pulsate--;
		if(te.render_pulsate <= 0)te.render_pulsate_increase = true;
	}
	GL11.glTranslated(x+0.5, y + 0.5, z+0.5);
	float scale = 0.7F + te.render_pulsate/1000F;
	GL11.glScalef(scale, scale, scale);
	if(te.rf.getMaxEnergyStored() == 0)GL11.glColor4d(0, 0, 0, 1);
	else GL11.glColor4d(te.rf.getEnergyStored()/(double)te.rf.getMaxEnergyStored() * 0.7, 0, 0, 1);
	ResourceLocation rL = new ResourceLocation(Defier.MODID + ":textures/blocks/blank.png");
	Minecraft.getMinecraft().getTextureManager().bindTexture(rL);
	GL11.glCallList(ClientProxy.defierSphereIdOutside);
	GL11.glCallList(ClientProxy.defierSphereIdInside);
	GL11.glColor4d(1, 1, 1, 1);
	GL11.glPopMatrix();
	
}
 
开发者ID:tiffit,项目名称:Defier,代码行数:27,代码来源:DefierTESR.java

示例2: drawFullCircle

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawFullCircle(int cx, int cy, double r, int c) {
	GL11.glScalef(0.5F, 0.5F, 0.5F);
	r *= 2;
	cx *= 2;
	cy *= 2;
	float f = (float) (c >> 24 & 0xff) / 255F;
	float f1 = (float) (c >> 16 & 0xff) / 255F;
	float f2 = (float) (c >> 8 & 0xff) / 255F;
	float f3 = (float) (c & 0xff) / 255F;
	GL11.glEnable(3042);
	GL11.glDisable(3553);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glBlendFunc(770, 771);
	GL11.glColor4f(f1, f2, f3, f);
	GL11.glBegin(GL11.GL_TRIANGLE_FAN);
	for (int i = 0; i <= 360; i++) {
		double x = Math.sin((i * Math.PI / 180)) * r;
		double y = Math.cos((i * Math.PI / 180)) * r;
		GL11.glVertex2d(cx + x, cy + y);
	}
	GL11.glEnd();
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
	GL11.glEnable(3553);
	GL11.glDisable(3042);
	GL11.glScalef(2F, 2F, 2F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:RenderUtils.java

示例3: enableLighting

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void enableLighting() {
    GL11.glDisable((int)3042);
    GL11.glEnable((int)3553);
    GL11.glDisable((int)2848);
    GL11.glDisable((int)3042);
    OpenGlHelper.setActiveTexture((int)OpenGlHelper.lightmapTexUnit);
    GL11.glMatrixMode((int)5890);
    GL11.glLoadIdentity();
    float var3 = 0.0039063f;
    GL11.glScalef((float)var3, (float)var3, (float)var3);
    GL11.glTranslatef((float)8.0f, (float)8.0f, (float)8.0f);
    GL11.glMatrixMode((int)5888);
    GL11.glTexParameteri((int)3553, (int)10241, (int)9729);
    GL11.glTexParameteri((int)3553, (int)10240, (int)9729);
    GL11.glTexParameteri((int)3553, (int)10242, (int)10496);
    GL11.glTexParameteri((int)3553, (int)10243, (int)10496);
    GL11.glColor4f((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
    OpenGlHelper.setActiveTexture((int)OpenGlHelper.defaultTexUnit);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:RenderUtils.java

示例4: drawScreen

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void drawScreen(int i, int j, float f)
{
    drawDefaultBackground();
    Tessellator tessellator = Tessellator.instance;
    char c = '\u0112';
    int k = width / 2 - c / 2;
    byte byte0 = 30;
    GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/title/mclogo.png"));
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    drawTexturedModalRect(k + 0, byte0 + 0, 0, 0, 155, 44);
    drawTexturedModalRect(k + 155, byte0 + 0, 0, 45, 155, 44);
    tessellator.setColorOpaque_I(0xffffff);
    GL11.glPushMatrix();
    GL11.glTranslatef(width / 2 + 90, 70F, 0.0F);
    GL11.glRotatef(-20F, 0.0F, 0.0F, 1.0F);
    float f1 = 1.8F - MathHelper.abs(MathHelper.sin(((float)(System.currentTimeMillis() % 1000L) / 1000F) * 3.141593F * 2.0F) * 0.1F);
    f1 = (f1 * 100F) / (float)(fontRenderer.getStringWidth(splashText) + 32);
    GL11.glScalef(f1, f1, f1);
    drawCenteredString(fontRenderer, splashText, 0, -8, 0xffff00);
    GL11.glPopMatrix();
    drawString(fontRenderer, "Minecraft Beta 1.7.3", 2, 2, 0x505050);
    drawString(fontRenderer, "BetaExpansion "+mod_BetaExpansion.version, 2, height-10, 0x505050);
    String s = "Copyright Mojang AB. Do not distribute.";
    drawString(fontRenderer, s, width - fontRenderer.getStringWidth(s) - 2, height - 10, 0xffffff);
    super.drawScreen(i, j, f);
}
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:27,代码来源:GuiMainMenu.java

示例5: drawName

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected void drawName(final String text, final float scale) {
    GL11.glScalef(scale, scale, scale);
    int strWidth = Client.font.getStringWidth(text);
    strWidth *= (int)scale;
    int x = this.x + (this.x1 - this.x) / 2 - strWidth / 2;
    int y = this.y + (this.y1 - this.y) / 2 - 4;
    x /= (int)scale;
    y /= (int)scale;
    Client.font.drawStringWithShadow(text, x, y, -1);
    GL11.glScalef(1.0f / scale, 1.0f / scale, 1.0f / scale);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:Button.java

示例6: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(Entity entity, float limbSwing, float limbSwingAmount, float rotateFloat, float rotateYaw,
		float rotatePitch, float scale) {
	GL11.glScalef(0.014F, 0.014F, 0.014F);
	GL11.glTranslatef(0F, -165F, 0F);
	this.setRotationAngles(limbSwing, limbSwingAmount, rotateFloat, rotateYaw, rotatePitch, scale, entity);
	this.top1.render(scale);
	this.top2.render(scale);
	this.top3.render(scale);
	// this.top3.setTextureOffset(120, 0);
	// this.top2.offsetY=0F;
	// this.top1.rotationPointX=0F;
	// this.leg1.setRotationPoint(0, 0, 0);
	// setRotation(leg1, 0F,0.4F,1.2F);
	// leg1.mirror = true;
	this.leg1.render(scale);
	this.leg1.offsetX = 3F;
	this.leg2.offsetX = 3F;
	this.leg3.offsetX = 3F;
	this.leg1.offsetY = 18F;
	this.leg2.offsetY = 18F;
	this.leg3.offsetY = 18F;
	this.leg1.offsetZ = -2F;
	this.leg2.offsetZ = -2F;
	this.leg3.offsetZ = -2F;
	// this.leg2.setRotationPoint(0, 0, 0);
	// setRotation(leg2, 0F, 0.4F, 1.9F);
	this.leg2.render(scale);
	// this.leg3.setRotationPoint(0, 0, 0);
	// setRotation(leg3, 0F,-0.4F, 1.6F);
	this.leg3.render(scale);

}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:34,代码来源:ModelEntityTripod.java

示例7: renderEquippedItems

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
protected void renderEquippedItems(EntityLivingBase entity, float unknown)
   {
	GL11.glColor3f(1.0F, 1.0F, 1.0F);
       super.renderEquippedItems(entity, unknown);
       
       ItemStack itemstack = entity.getHeldItem();	// The weapon you're holding
       
       if (itemstack != null && itemstack.getItem() != null) 
       { 
       	 GL11.glPushMatrix();

            GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);

            float scale = 0.625F;

            GL11.glTranslatef(0.3F, 0.2F, -0.25F);		// 0.0F, 0.1875F, 0.0F, left/right, up/down, forward/backward?
            GL11.glScalef(scale, -scale, scale);
            GL11.glRotatef(-20.0F, 1.0F, 0.0F, 0.0F);	// -100
            GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);

            int color = itemstack.getItem().getColorFromItemStack(itemstack, 0);
            float colorR = (float) (color >> 16 & 255) / 255.0F;
            float colorB = (float) (color >> 8 & 255) / 255.0F;
            float colorG = (float) (color & 255) / 255.0F;
            GL11.glColor4f(colorR, colorB, colorG, 1.0F);
           
            this.renderManager.itemRenderer.renderItem(entity, itemstack, 0);

            GL11.glPopMatrix();
       }
       
       this.renderStoredItems((Entity_BB) entity);
   }
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:35,代码来源:Render_FlyingAA.java

示例8: renderItem

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
	GL11.glPushMatrix();
	GL11.glTranslated(0.5, .5, .5);
	GL11.glScalef(0.7F, 0.7F, 0.7F);
	GL11.glColor4f(0f, 0f, 0f, 1f);
	ResourceLocation rL = new ResourceLocation(Defier.MODID + ":textures/blocks/blank.png");
	Minecraft.getMinecraft().getTextureManager().bindTexture(rL);
	GL11.glCallList(ClientProxy.defierSphereIdOutside);
	GL11.glCallList(ClientProxy.defierSphereIdInside);
	GL11.glPopMatrix();
	GL11.glColor4f(1f, 1f, 1f, 1f);
}
 
开发者ID:tiffit,项目名称:Defier,代码行数:14,代码来源:RenderDefierItem.java

示例9: drawEnchantTag

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void drawEnchantTag(final String text, int x, int y) {
    GlStateManager.pushMatrix();
    GlStateManager.disableDepth();
    x *= (int)1.75;
    y -= 4;
    GL11.glScalef(0.57f, 0.57f, 0.57f);
    Client.font.drawStringWithShadow(text, x, -36 - y, -1286);
    GlStateManager.enableDepth();
    GlStateManager.popMatrix();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:Tags.java

示例10: 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 doesn't do that.
 */
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
    Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);

    if (icon != null)
    {
        GL11.glPushMatrix();
        GL11.glTranslatef((float)par2, (float)par4, (float)par6);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glScalef(0.5F, 0.5F, 0.5F);
        this.bindEntityTexture(par1Entity);
        Tessellator tessellator = Tessellator.instance;

        if (icon == ItemPotion.func_94589_d("bottle_splash"))
        {
            int i = PotionHelper.func_77915_a(((EntityPotion)par1Entity).getPotionDamage(), false);
            float f2 = (float)(i >> 16 & 255) / 255.0F;
            float f3 = (float)(i >> 8 & 255) / 255.0F;
            float f4 = (float)(i & 255) / 255.0F;
            GL11.glColor3f(f2, f3, f4);
            GL11.glPushMatrix();
            this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay"));
            GL11.glPopMatrix();
            GL11.glColor3f(1.0F, 1.0F, 1.0F);
        }

        this.func_77026_a(tessellator, icon);
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
    }
}
 
开发者ID:marcus8448,项目名称:IceMod,代码行数:38,代码来源:RenderHunkOIce.java

示例11: scale

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void scale(float x, float y, float z)
{
    GL11.glScalef(x, y, z);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:GlStateManager.java

示例12: doRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void doRender(EntityStickProjectile entity, double x, double y, double z, float yaw, float partialTick) {
	GL11.glPushMatrix();
	GL11.glTranslatef((float) x, (float) y, (float) z);
	GL11.glColor4f(0.7F, 0.7F, 0.7F, 1F);
	GL11.glScalef(0.25f, 0.25f, 0.25f);
	GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTick, 0.0F, 1.0F,
			0.0F);
	GL11.glRotatef(
			(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTick) * -1, 1.0F,
			0.0F, 0.0F);

	bindEntityTexture(entity);

	// GL11.glTranslatef((float)entity.posX, (float)entity.posY,
	// entity.posZ);
	if (entity.getCritical() == 2) {
		// GlStateManager.disableTexture2D();
		GlStateManager.disableLighting();
		// GL11.glColor4f(0.0F, 0.0F, 1.0F, 1F);
		model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);
		// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
		// GlStateManager.enableTexture2D();
		GlStateManager.enableLighting();
	} else
		model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);

	/*
	 * GL11.glScalef(1.5f, 1.5f, 1.5f); GL11.glEnable(GL11.GL_BLEND);
	 * //GL11.glDisable(GL11.GL_ALPHA_TEST); OpenGlHelper.glBlendFunc(770,
	 * 771, 1, 0);
	 * 
	 * char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536;
	 * OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,
	 * (float)j / 1.0F, (float)k / 1.0F);
	 * 
	 * model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);
	 * GL11.glDisable(GL11.GL_BLEND); // GL11.glEnable(GL11.GL_ALPHA_TEST);
	 */
	GL11.glColor4f(1F, 1F, 1F, 1F);
	GL11.glPopMatrix();
	/*
	 * IIcon iicon = TF2EventBusListener.pelletIcon;
	 * 
	 * if (iicon != null) { GL11.glPushMatrix();
	 * GL11.glTranslatef((float)x,(float) y,(float) z);
	 * GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F,
	 * 0.5F); this.bindTexture(TextureMap.locationItemsTexture); Tessellator
	 * tessellator = Tessellator.instance;
	 * 
	 * float f = iicon.getMinU(); float f1 = iicon.getMaxU(); float f2 =
	 * iicon.getMinV(); float f3 = iicon.getMaxV(); float f4 = 1.0F; float
	 * f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180.0F -
	 * this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
	 * GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
	 * tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F,
	 * 0.0F); tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F
	 * - f6), 0.0D, (double)f, (double)f3);
	 * tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6),
	 * 0.0D, (double)f1, (double)f3);
	 * tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6),
	 * 0.0D, (double)f1, (double)f2);
	 * tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6),
	 * 0.0D, (double)f, (double)f2); tessellator.draw();
	 * GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix();
	 * 
	 * }
	 */

}
 
开发者ID:rafradek,项目名称:Mods,代码行数:71,代码来源:RenderSyringe.java

示例13: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(String text, Vec2 pos, float size, Alignment align)
{
    LineMetrics metrics = font.getLineMetrics(text, frc);
    GlyphVector vector = font.createGlyphVector(frc, text);
    Rectangle2D bounds = vector.getLogicalBounds();
    
    Vec2 rad = new Vec2((float)bounds.getWidth(), (float)bounds.getHeight()).mult(0.5f);
    
    GL11.glPushMatrix();
    GL11.glTranslatef(pos.x, pos.y, 0.0f);
    GL11.glScalef(size, -size, 0.0f);
    GL11.glTranslatef((align.x - 1.0f)*rad.x, (-align.y + 1.0f)*rad.y - metrics.getDescent(), 0.0f);
    
    float[] coords = new float[6];
    float loopX = 0.0f, loopY = 0.0f;
    float px = 0.0f, py = 0.0f;
    
    GL11.glBegin(GL11.GL_LINES);
    for (PathIterator path = vector.getOutline().getPathIterator(identity); !path.isDone(); path.next())
    {
        int code = path.currentSegment(coords);
        float x = coords[0], y = coords[1];
        
        switch (code)
        {
            case PathIterator.SEG_MOVETO: //End segment and move to a new position.
                px = x;
                py = y;
                loopX = x;
                loopY = y;
                break;
            default: //Draw line from previous to current.
                GL11.glVertex2f(px, py);
                GL11.glVertex2f(x, y);
                px = x;
                py = y;
                break;
            case PathIterator.SEG_CLOSE: //Draw line to close loop.
                GL11.glVertex2f(x, y);
                GL11.glVertex2f(loopX, loopY);
                px = 0.0f;
                py = 0.0f;
                loopX = 0.0f;
                loopY = 0.0f;
                break;
        }
    }
    GL11.glEnd();
    
    GL11.glPopMatrix();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:52,代码来源:VectorFont.java

示例14: preRenderCallback

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
protected void preRenderCallback(EntityLivingBase entityliving, float patialTickTime) {
	GL11.glScalef(0.65F, 0.65F, 0.65F);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:5,代码来源:RabbitRenderer.java

示例15: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(EntityProjectileSharpStone 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();
}
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:50,代码来源:RenderSharpStone.java


注:本文中的org.lwjgl.opengl.GL11.glScalef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。