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


Java GL11.glColor3f方法代码示例

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


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

示例1: renderTileEntityAt

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntityCrank te, double x, double y, double z, float partialTicks, int destroyStage) {
    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_LIGHTING);
    
    GL11.glTranslatef((float) x + 0.5f, (float) y + 1.50f, (float) z + 0.5f);
    GL11.glRotatef(180f, 1f, 0f, 0f);
    GL11.glScaled(1, 1, 1);
    
    mc.renderEngine.bindTexture(texture);
    model.render(0.0625f);
    GL11.glColor3f(1f, 1f, 1f);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();
    
    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glTranslatef((float) x + 0.5f, (float) y + 1.50f, (float) z + 0.5f);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:22,代码来源:RenderCrank.java

示例2: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
void render()
{
    GL11.glLineWidth(1.0f);
    GL11.glColor3f(COLOR, COLOR, COLOR);
    GL11.glBegin(GL11.GL_LINES);
    for (int ix = -WIDTH; ix <= WIDTH; ix++)
    {
        float x = ix*SIZE;
        GL11.glVertex3f(x, FLOOR_HEIGHT, -REAL_WIDTH);
        GL11.glVertex3f(x, FLOOR_HEIGHT, REAL_WIDTH);
    }
    
    for (int iz = -WIDTH; iz <= WIDTH; iz++)
    {
        float z = iz*SIZE;
        GL11.glVertex3f(-REAL_WIDTH, FLOOR_HEIGHT, z);
        GL11.glVertex3f(REAL_WIDTH, FLOOR_HEIGHT, z);
    }
    GL11.glEnd();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:21,代码来源:Grid.java

示例3: renderInventoryBlock

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
	block.setBlockBounds(0.005F, 0.005F, 0.005F, 0.995F, 0.995F, 0.995F);
	renderer.setRenderBoundsFromBlock(block);

	if (metadata < 6) {
		drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[0], ((BlockInfusedBlockOre) block).icon[1],
				((BlockInfusedBlockOre) block).icon[2], ((BlockInfusedBlockOre) block).icon[3],
				((BlockInfusedBlockOre) block).icon[4], ((BlockInfusedBlockOre) block).icon[5], false);
		Color c = new Color(BlockCustomOreItem.colors[metadata + 1]);
		float r = c.getRed() / 255.0F;
		float g = c.getGreen() / 255.0F;
		float b = c.getBlue() / 255.0F;
		GL11.glColor3f(r, g, b);
		block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
		renderer.setRenderBoundsFromBlock(block);
		drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[6], false);
		GL11.glColor3f(1.0F, 1.0F, 1.0F);
	}
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:21,代码来源:BlockInfusedBlockOreRenderer.java

示例4: setWoolColorAndRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected boolean setWoolColorAndRender(EntitySheep entitysheep, int i, float f)
{
    if(i == 0 && !entitysheep.getSheared())
    {
        loadTexture("/mob/sheep_fur.png");
        int j = entitysheep.getFleeceColor();
        GL11.glColor3f(EntitySheep.fleeceColorTable[j][0], EntitySheep.fleeceColorTable[j][1], EntitySheep.fleeceColorTable[j][2]);
        return true;
    } else
    {
        return false;
    }
}
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:14,代码来源:RenderSheep.java

示例5: renderItem

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderItem(ItemStack stack, int x, int y) {
    this.itemRender.field_77023_b = -50.0f;
    this.itemRender.func_82406_b(Wrapper.fontRenderer(), Wrapper.getMinecraft().func_110434_K(), stack, x, y);
    this.itemRender.func_77021_b(Wrapper.fontRenderer(), Wrapper.getMinecraft().func_110434_K(), stack, x, y);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glColor3f(1.0f, 1.0f, 1.0f);
    GL11.glScalef(0.5f, 0.5f, 0.5f);
    this.renderEnchantmentText(stack, x, y);
    GL11.glScalef(2.0f, 2.0f, 2.0f);
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:11,代码来源:ModuleNametags.java

示例6: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render()
{
    GL11.glClearColor(SKY_COLOR, SKY_COLOR, SKY_COLOR, 0.0f);
    GL11.glClearStencil(0);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
    
    GL11.glColor3f(GROUND_COLOR, GROUND_COLOR, GROUND_COLOR);
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
    GL11.glVertex3f(-1.0f, 0.0f, 1.0f);
    GL11.glVertex3f(1.0f, 0.0f, 1.0f);
    GL11.glVertex3f(1.0f, -1.0f, 1.0f);
    
    GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, 0.0f, -1.f);
    GL11.glVertex3f(1.0f, 0.0f, -1.0f);
    GL11.glVertex3f(1.0f, -1.0f, -1.0f);
    
    GL11.glVertex3f(1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(1.0f, 0.0f, -1.0f);
    GL11.glVertex3f(1.0f, 0.0f, 1.0f);
    GL11.glVertex3f(1.0f, -1.0f, 1.0f);
    
    GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, 0.0f, -1.0f);
    GL11.glVertex3f(-1.0f, 0.0f, 1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
    
    GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
    GL11.glVertex3f(1.0f, -1.0f, 1.0f);
    GL11.glVertex3f(1.0f, -1.0f, -1.0f);
    GL11.glEnd();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:35,代码来源:Skybox.java

示例7: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render()
{
    //Line
    GL11.glLineWidth(1.0f);
    GL11.glColor3f(0.0f, 0.0f, 0.0f);
    GL11.glBegin(GL11.GL_LINES);
    GraphicsUtil.glVertex(a.pos);
    GraphicsUtil.glVertex(b.pos);
    GL11.glEnd();
    
    //Arrow
    if (type == Type.END && abLen > ARROW_LENGTH)
    {
        Vec3 n = Vec3.sub(Main.instance().getCamera().pos, b.pos).cross(ab).normalize();

        GL11.glBegin(GL11.GL_TRIANGLES);
        GraphicsUtil.glVertex(Vec3.madd(b.pos, n, ARROW_WIDTH).madd(ab, -ARROW_LENGTH));
        GraphicsUtil.glVertex(b.pos);
        GraphicsUtil.glVertex(Vec3.madd(b.pos, n, -ARROW_WIDTH).madd(ab, -ARROW_LENGTH));
        GL11.glEnd();
    }
    
    //Point
    GL11.glPointSize(4.0f);
    GL11.glBegin(GL11.GL_POINTS);
    if (Main.instance().getFocus() == a) GL11.glColor3f(0.75f, 0.75f, 1.0f);
    else GL11.glColor3f(0.0f, 0.0f, 0.0f);
    GraphicsUtil.glVertex(a.pos);
    
    if (type == Type.END)
    {
        if (Main.instance().getFocus() == b) GL11.glColor3f(0.75f, 0.75f, 1.0f);
        else GL11.glColor3f(0.0f, 0.0f, 0.0f);
        GraphicsUtil.glVertex(b.pos);
    }
    GL11.glEnd();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:39,代码来源:Wire.java

示例8: 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

示例9: preSkyList

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void preSkyList()
{
    setUpPosition();
    GL11.glColor3f(fogColorR, fogColorG, fogColorB);
    drawHorizon();
    GL11.glColor3f(skyColorR, skyColorG, skyColorB);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:Shaders.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: preSkyList

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void preSkyList()
{
    GL11.glColor3f(fogColorR, fogColorG, fogColorB);
    drawHorizon();
    GL11.glColor3f(skyColorR, skyColorG, skyColorB);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:7,代码来源:Shaders.java

示例12: onRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@EventTarget
private void onRender(final Render3DEvent event) {
    GlStateManager.pushMatrix();
    final float[] rainbowArray = this.getRainbow();
    for (Object o : this.mc.theWorld.loadedEntityList) {
    	Entity ent = (Entity)o;
        if (!this.farmHunt) {
            if (!(ent instanceof EntityPlayer) && !(ent instanceof EntityMob)) {
                continue;
            }
            if (ent instanceof EntityPlayer && !this.players) {
                continue;
            }
            if (ent instanceof EntityMob && !this.monsters) {
                continue;
            }
        }
        if ((!(ent instanceof EntityLivingBase) || ((EntityLivingBase)ent).getMaxHealth() <= 20.0f || ((EntityLivingBase)ent).isInvisible() || ent instanceof EntityHorse) && this.farmHunt) {
            continue;
        }
        if (!ent.isEntityAlive()) {
            continue;
        }
        final double x = this.getDiff(ent.lastTickPosX, ent.posX, event.partialTicks, RenderManager.renderPosX);
        final double y = this.getDiff(ent.lastTickPosY, ent.posY, event.partialTicks, RenderManager.renderPosY);
        final double z = this.getDiff(ent.lastTickPosZ, ent.posZ, event.partialTicks, RenderManager.renderPosZ);
        if (FriendManager.isFriend(ent.getName())) {
            GL11.glColor3f(0.27f, 0.7f, 0.92f);
            if (this.rainbow) {
                GL11.glColor3f(rainbowArray[0], rainbowArray[1], rainbowArray[2]);
            }
        }
        else {
            final float distance = this.mc.thePlayer.getDistanceToEntity(ent);
            if (distance <= 32.0f) {
                GL11.glColor3f(distance / 32.0f, 0.0f, 0.0f);
            }
            else {
                GL11.glColor3f(0.9f, 0.0f, 0.0f);
            }
        }
        GL11.glLoadIdentity();
        final boolean bobbing = this.mc.gameSettings.viewBobbing;
        this.mc.gameSettings.viewBobbing = false;
        this.mc.entityRenderer.orientCamera(event.partialTicks);
        GL11.glLineWidth(1.2f);
        GL11.glBegin(3);
        GL11.glVertex3d(0.0, (double)this.mc.thePlayer.getEyeHeight(), 0.0);
        GL11.glVertex3d(x, y, z);
        GL11.glVertex3d(x, y + ent.getEyeHeight(), z);
        GL11.glEnd();
        this.mc.gameSettings.viewBobbing = bobbing;
    }
    GlStateManager.popMatrix();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:56,代码来源:Tracers.java

示例13: colour

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void colour(float r, float g, float b) {
	GL11.glColor3f(r, g, b);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:4,代码来源:OpenGLHelper.java

示例14: glColor3f

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glColor3f(float red, float green, float blue) {
	GL11.glColor3f(red, green, blue);
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:4,代码来源:IGL11.java

示例15: onRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRender() {
	if(isEnabled()) {
		try {
			GL11.glPushMatrix();
			GL11.glEnable(GL11.GL_LINE_SMOOTH);
			GL11.glDisable(GL11.GL_DEPTH_TEST);
			GL11.glDisable(GL11.GL_TEXTURE_2D);
			GL11.glDepthMask(false);
			GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
			GL11.glEnable(GL11.GL_BLEND);
			GL11.glLineWidth(1.5F);
			for (Entity entities : Client.mc.world.loadedEntityList) {
				if (entities != Client.mc.player && entities != null) {
					if (entities instanceof EntityPlayer) {
						float distance = Client.mc.renderViewEntity.getDistanceToEntity(entities);
						double posX = ((entities.lastTickPosX + (entities.posX - entities.lastTickPosX)
								- RenderManager.renderPosX));
						double posY = ((entities.lastTickPosY + (entities.posY - entities.lastTickPosY)
								- RenderManager.renderPosY));
						double posZ = ((entities.lastTickPosZ + (entities.posZ - entities.lastTickPosZ)
								- RenderManager.renderPosZ));
	
						if(Wrapper.getFriends().isFriend(entities.getName())) {
	    					GL11.glColor3f(0.0F, 1.0F, 0.0F);
	    				}else{
							if (distance <= 6F) {
								GL11.glColor3f(1.0F, 0.0F, 0.0F);
							} else if (distance <= 96F) {
								GL11.glColor3f(1.0F, (distance / 100F), 0.0F);
							} else if (distance > 96F) {
								GL11.glColor3f(0.1F, 0.6F, 255.0F);
							}
	    				}
						Vec3d eyes = new Vec3d(0, 0, 1).rotatePitch(-(float) Math.toRadians(Wrapper.getPlayer().rotationPitch)).rotateYaw(-(float) Math.toRadians(Wrapper.getPlayer().rotationYaw));
						
						GL11.glBegin(GL11.GL_LINE_LOOP);
						
						GL11.glVertex3d(eyes.xCoord, Wrapper.getPlayer().getEyeHeight() + eyes.yCoord, eyes.zCoord);
						GL11.glVertex3d(posX, posY, posZ);
	
						GL11.glEnd();
					}
				}
			}
			GL11.glDisable(GL11.GL_BLEND);
			GL11.glDepthMask(true);
			GL11.glEnable(GL11.GL_TEXTURE_2D);
			GL11.glEnable(GL11.GL_DEPTH_TEST);
			GL11.glDisable(GL11.GL_LINE_SMOOTH);
			GL11.glPopMatrix();
		} catch (Exception e) {}
	}
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:55,代码来源:Tracers.java


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