本文整理汇总了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();
}
示例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();
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例9: preSkyList
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void preSkyList()
{
setUpPosition();
GL11.glColor3f(fogColorR, fogColorG, fogColorB);
drawHorizon();
GL11.glColor3f(skyColorR, skyColorG, skyColorB);
}
示例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();
}
}
示例11: preSkyList
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void preSkyList()
{
GL11.glColor3f(fogColorR, fogColorG, fogColorB);
drawHorizon();
GL11.glColor3f(skyColorR, skyColorG, skyColorB);
}
示例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();
}
示例13: colour
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void colour(float r, float g, float b) {
GL11.glColor3f(r, g, b);
}
示例14: glColor3f
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glColor3f(float red, float green, float blue) {
GL11.glColor3f(red, green, blue);
}
示例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) {}
}
}