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


Java GL11.glTranslated方法代码示例

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


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

示例1: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void render(double x, double y, double z, double gunRadius) {
    if (isMinigunActivated() && getMinigunSpeed() == MAX_GUN_SPEED && gunAimedAtTarget && attackTarget != null) {
        GL11.glPushMatrix();
        GL11.glScaled(1, 1, 1);
        GL11.glTranslated(-x, -y, -z);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        //GL11.glDisable(GL11.GL_LIGHTING);
        RenderUtils.glColorHex(0xFF000000 | getAmmoColor());
        for (int i = 0; i < 5; i++) {

            Vec3d vec = new Vec3d(attackTarget.posX - x, attackTarget.posY - y, attackTarget.posZ - z).normalize();
            minigunFire.startX = x + vec.x * gunRadius;
            minigunFire.startY = y + vec.y * gunRadius;
            minigunFire.startZ = z + vec.z * gunRadius;
            minigunFire.endX = attackTarget.posX + rand.nextDouble() - 0.5;
            minigunFire.endY = attackTarget.posY + attackTarget.height / 2 + rand.nextDouble() - 0.5;
            minigunFire.endZ = attackTarget.posZ + rand.nextDouble() - 0.5;
            minigunFire.render();
        }
        GL11.glColor4d(1, 1, 1, 1);
        // GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glPopMatrix();
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:27,代码来源:Minigun.java

示例2: renderModel

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void renderModel(float size, float[] angles) {
    GL11.glPushMatrix();
    GL11.glRotatef(angles[0], 0, 1, 0);
    baseTurn.render(size);
    baseTurn2.render(size);
    GL11.glTranslated(0, 18 / 16F, 0);
    GL11.glRotatef(angles[1], 1, 0, 0);
    GL11.glTranslated(0, -18 / 16F, 0);
    armBase1.render(size);
    armBase2.render(size);
    supportMiddle.render(size);
    GL11.glTranslated(0, 18 / 16F, 6 / 16F);
    GL11.glRotatef(angles[2], 1, 0, 0);
    GL11.glTranslated(0, -18 / 16F, -6 / 16F);
    armMiddle1.render(size);
    armMiddle2.render(size);
    GL11.glTranslated(0, 3 / 16F, 6 / 16F);
    GL11.glRotatef(angles[3], 1, 0, 0);
    GL11.glTranslated(0, -3 / 16F, -6 / 16F);
    drillBase.render(size);
    GL11.glTranslated(0, 3 / 16F, 0);
    GL11.glRotatef(angles[4], 0, 0, 1);
    GL11.glTranslated(0, -3 / 16F, 0);
    drill.render(size);
    GL11.glPopMatrix();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:27,代码来源:ModelAssemblyDrill.java

示例3: onControllerDrag

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
protected void onControllerDrag()
{
	Part part = selectedPart;
	if(part instanceof PartObj || part instanceof PartRotation)
		super.onControllerDrag();
	else
	{
		GL11.glPushMatrix();
		if(part instanceof PartEntityPos)
			GL11.glTranslated(-entityToRender.posX, -entityToRender.posY, -entityToRender.posZ);
		int i = translationAxisPlane == 0 ? 2 : translationAxisPlane - 1;
		translationGuidePoint = getMouseVectorInPlane(i);
		processAxisDrag();
		GL11.glPopMatrix();
	}
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:18,代码来源:GuiEntityRendererWithTranslation.java

示例4: drawPlusAndMinus

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void drawPlusAndMinus() {
    double scale = 0.05D;
    GL11.glPushMatrix();
    GL11.glTranslated(0.26D, 13.95D / 16D, 0);
    GL11.glRotated(90, 1, 0, 0);
    GL11.glScaled(scale, scale, scale);
    GL11.glColor4d(0, 1, 0, 1);
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder bufferBuilder = tessellator.getBuffer();
    bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
    bufferBuilder.pos(-1, 0, 0).endVertex();
    bufferBuilder.pos(1, 0, 0).endVertex();
    bufferBuilder.pos(0, -1, 0).endVertex();
    bufferBuilder.pos(0, 1, 0).endVertex();
    tessellator.draw();
    GL11.glTranslated(-0.52D / scale, 0, 0);
    GL11.glColor4d(1, 0, 0, 1);
    bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
    bufferBuilder.pos(-1, 0, 0).endVertex();
    bufferBuilder.pos(1, 0, 0).endVertex();
    tessellator.draw();
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glPopMatrix();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:25,代码来源:ModelVacuumPump.java

示例5: renderPreview

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private void renderPreview() {
    if (!hasTicked) {
        TileEntityPneumaticBase tile = (TileEntityPneumaticBase) getTube();
        NetworkHandler.sendToServer(new PacketDescriptionPacketRequest(tile.getPos()));
        TileEntity neighbor = tile.getWorld().getTileEntity(tile.getPos().offset(dir));
        inLine = neighbor instanceof IPneumaticMachine;
        if (inLine) {
            IAirHandler neighborHandler = ((IPneumaticMachine) neighbor).getAirHandler(dir);
            inverted = neighborHandler != null && neighborHandler.getPressure() > tile.getAirHandler(null).getPressure();
            NetworkHandler.sendToServer(new PacketDescriptionPacketRequest(neighbor.getPos()));
        }
        hasTicked = true;
    }

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    if (inLine && !inverted) {
        GL11.glColor4d(0, 1, 0, 0.3);
    } else {
        GL11.glColor4d(1, 0, 0, 0.3);
    }
    GL11.glPushMatrix();
    GL11.glTranslated(0, 1, 0.2 + ClientTickHandler.TICKS % 20 * 0.015);
    GL11.glRotated(90, 1, 0, 0);

    RenderUtils.render3DArrow();
    GL11.glColor4d(1, 1, 1, 0.5);  // 0.5 because we're rendering a preview
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_BLEND);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:32,代码来源:ModuleRegulatorTube.java

示例6: renderVortex

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderVortex(EntityVortex entity, double x, double y, double z, float var1, float partialTicks) {
    int circlePoints = 200;
    double radius = 0.5D;
    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor4d(0.8, 0.8, 0.8D, 0.7D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glTranslatef((float) x, (float) y, (float) z);
    GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);

    GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks, 0.0F, 1.0F, 0.0F);

    for (int i = 0; i < circlePoints; i++) {
        float angleRadians = (float) i / (float) circlePoints * 2F * (float) Math.PI;
        GL11.glPushMatrix();
        GL11.glTranslated(radius * Math.sin(angleRadians), radius * Math.cos(angleRadians), 0);
        renderGust();
        GL11.glPopMatrix();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();

}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:29,代码来源:RenderEntityVortex.java

示例7: onRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRender(float partialTicks)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glColor4f(1F, 0F, 0F, 0.15F);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-mc.getRenderManager().renderPosX,
		-mc.getRenderManager().renderPosY,
		-mc.getRenderManager().renderPosZ);
	
	// vertices
	GL11.glBegin(GL11.GL_QUADS);
	{
		for(int[] vertex : vertices)
			GL11.glVertex3d(vertex[0], vertex[1], vertex[2]);
	}
	GL11.glEnd();
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:32,代码来源:BaseFinderMod.java

示例8: onRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRender(float partialTicks)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-mc.getRenderManager().renderPosX,
		-mc.getRenderManager().renderPosY,
		-mc.getRenderManager().renderPosZ);
	
	// minecart interpolation
	ArrayList<AxisAlignedBB> minecartBoxes =
		new ArrayList<>(minecarts.size());
	minecarts.forEach(e -> {
		double offsetX = -(e.posX - e.lastTickPosX)
			+ (e.posX - e.lastTickPosX) * partialTicks;
		double offsetY = -(e.posY - e.lastTickPosY)
			+ (e.posY - e.lastTickPosY) * partialTicks;
		double offsetZ = -(e.posZ - e.lastTickPosZ)
			+ (e.posZ - e.lastTickPosZ) * partialTicks;
		minecartBoxes.add(e.boundingBox.offset(offsetX, offsetY, offsetZ));
	});
	
	GL11.glCallList(normalChests);
	
	GL11.glColor4f(0, 1, 0, 0.25F);
	renderBoxes(minecartBoxes, solidBox);
	GL11.glColor4f(0, 1, 0, 0.5F);
	renderBoxes(minecartBoxes, outlinedBox);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:47,代码来源:ChestEspMod.java

示例9: onRenderGUI

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRenderGUI()
{
	if(target == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_CULL_FACE);
	
	GL11.glPushMatrix();
	
	String message;
	if(velocity < 1)
		message = "Charging: " + (int)(velocity * 100) + "%";
	else
		message = "Ready To Shoot";
	
	// translate to center
	ScaledResolution sr = new ScaledResolution(mc);
	int msgWidth = Fonts.segoe15.getStringWidth(message);
	GL11.glTranslated(sr.getScaledWidth() / 2 - msgWidth / 2,
		sr.getScaledHeight() / 2 + 1, 0);
	
	// background
	GL11.glColor4f(0, 0, 0, 0.5F);
	GL11.glBegin(GL11.GL_QUADS);
	{
		GL11.glVertex2d(0, 0);
		GL11.glVertex2d(msgWidth + 3, 0);
		GL11.glVertex2d(msgWidth + 3, 10);
		GL11.glVertex2d(0, 10);
	}
	GL11.glEnd();
	
	// text
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	Fonts.segoe15.drawString(message, 2, -1, 0xffffffff);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_BLEND);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:48,代码来源:BowAimbotMod.java

示例10: 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();
   }
 
开发者ID:Kanbe-Kotori,项目名称:ExtraAcC,代码行数:53,代码来源:RenderAirGun.java

示例11: drawStrip

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawStrip(int x, int y, float width, double angle, float points, float radius, int color) {
    float yc;
    float xc;
    float a;
    int i;
    float f1 = (float)(color >> 24 & 255) / 255.0f;
    float f2 = (float)(color >> 16 & 255) / 255.0f;
    float f3 = (float)(color >> 8 & 255) / 255.0f;
    float f4 = (float)(color & 255) / 255.0f;
    GL11.glPushMatrix();
    GL11.glTranslated((double)x, (double)y, (double)0.0);
    GL11.glColor4f((float)f2, (float)f3, (float)f4, (float)f1);
    GL11.glLineWidth((float)width);
    if (angle > 0.0) {
        GL11.glBegin((int)3);
        i = 0;
        while ((double)i < angle) {
            a = (float)((double)i * (angle * 3.141592653589793 / (double)points));
            xc = (float)(Math.cos(a) * (double)radius);
            yc = (float)(Math.sin(a) * (double)radius);
            GL11.glVertex2f((float)xc, (float)yc);
            ++i;
        }
        GL11.glEnd();
    }
    if (angle < 0.0) {
        GL11.glBegin((int)3);
        i = 0;
        while ((double)i > angle) {
            a = (float)((double)i * (angle * 3.141592653589793 / (double)points));
            xc = (float)(Math.cos(a) * (double)(- radius));
            yc = (float)(Math.sin(a) * (double)(- radius));
            GL11.glVertex2f((float)xc, (float)yc);
            --i;
        }
        GL11.glEnd();
    }
    RenderUtils.disableGL2D();
    GL11.glDisable((int)3479);
    GL11.glPopMatrix();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:42,代码来源:RenderUtils.java

示例12: translate

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

示例13: onRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRender(float partialTicks)
{
	if(currentBlock == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-TileEntityRendererDispatcher.staticPlayerX,
		-TileEntityRendererDispatcher.staticPlayerY,
		-TileEntityRendererDispatcher.staticPlayerZ);
	
	AxisAlignedBB box = new AxisAlignedBB(BlockPos.ORIGIN);
	float p = prevProgress + (progress - prevProgress) * partialTicks;
	float red = p * 2F;
	float green = 2 - red;
	
	GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
		currentBlock.getZ());
	if(p < 1)
	{
		GL11.glTranslated(0.5, 0.5, 0.5);
		GL11.glScaled(p, p, p);
		GL11.glTranslated(-0.5, -0.5, -0.5);
	}
	
	GL11.glColor4f(red, green, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(red, green, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:49,代码来源:NukerMod.java

示例14: onRender

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRender(float partialTicks)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-mc.getRenderManager().renderPosX,
		-mc.getRenderManager().renderPosY,
		-mc.getRenderManager().renderPosZ);
	
	// set start position
	Vec3d start = RotationUtils.getClientLookVec()
		.addVector(0, WMinecraft.getPlayer().getEyeHeight(), 0)
		.addVector(mc.getRenderManager().renderPosX,
			mc.getRenderManager().renderPosY,
			mc.getRenderManager().renderPosZ);
	
	GL11.glBegin(GL11.GL_LINES);
	for(EntityPlayer entity : WMinecraft.getWorld().playerEntities)
	{
		if(entity == WMinecraft.getPlayer()
			|| entity instanceof EntityFakePlayer)
			continue;
		
		// fake entities with crazy vertical position
		if(Math.abs(entity.posY - WMinecraft.getPlayer().posY) > 1e6)
			continue;
		
		if(!wurst.special.targetSpf.sleepingPlayers.isChecked()
			&& entity.isPlayerSleeping())
			continue;
		
		if(!wurst.special.targetSpf.invisiblePlayers.isChecked()
			&& entity.isInvisible())
			continue;
		
		// set end position
		Vec3d end = entity.boundingBox.getCenter()
			.subtract(new Vec3d(entity.posX, entity.posY, entity.posZ)
				.subtract(entity.prevPosX, entity.prevPosY, entity.prevPosZ)
				.scale(1 - partialTicks));
		
		// set color
		if(wurst.friends.contains(entity.getName()))
			GL11.glColor4f(0, 0, 1, 0.5F);
		else
		{
			float factor =
				WMinecraft.getPlayer().getDistanceToEntity(entity) / 40F;
			if(factor > 1)
				factor = 1;
			
			GL11.glColor4f(2 - factor * 2F, factor * 2F, 0, 0.5F);
		}
		
		// draw line
		GL11.glVertex3d(start.xCoord, start.yCoord, start.zCoord);
		GL11.glVertex3d(end.xCoord, end.yCoord, end.zCoord);
	}
	GL11.glEnd();
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:77,代码来源:TracersMod.java

示例15: renderModel

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void renderModel(float size, float[] angles, boolean laserOn) {
    GlStateManager.pushMatrix();

    GL11.glRotatef(angles[0], 0, 1, 0);
    baseTurn.render(size);
    baseTurn2.render(size);
    GL11.glTranslated(0, 18 / 16F, 0);
    GL11.glRotatef(angles[1], 1, 0, 0);
    GL11.glTranslated(0, -18 / 16F, 0);
    armBase1.render(size);
    armBase2.render(size);
    supportMiddle.render(size);
    GL11.glTranslated(0, 18 / 16F, 6 / 16F);
    GL11.glRotatef(angles[2], 1, 0, 0);
    GL11.glTranslated(0, -18 / 16F, -6 / 16F);
    armMiddle1.render(size);
    armMiddle2.render(size);
    GL11.glTranslated(0, 3 / 16F, 6 / 16F);
    GL11.glRotatef(angles[3], 1, 0, 0);
    GL11.glTranslated(0, -3 / 16F, -6 / 16F);
    laserBase.render(size);
    if (laserOn) {
        GL11.glPushMatrix();
        GL11.glTranslated(0, 2.75 / 16D, 1 / 16D);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glColor4d(1.0D, 0.1D, 0, 1);
        laser.render(size / 8);
        GL11.glPopMatrix();
        GL11.glColor4d(1, 1, 1, 1);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
    double textSize = 1 / 150D;
    GL11.glScaled(textSize, textSize, textSize);
    GL11.glRotated(-90, 1, 0, 0);
    GL11.glTranslated(0, 0, 18);
    GL11.glDisable(GL11.GL_LIGHTING);
    GuiPneumaticContainerBase.drawTexture(Textures.GUI_LASER_DANGER, -8, -65);
    GL11.glEnable(GL11.GL_LIGHTING);

    GlStateManager.popMatrix();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:42,代码来源:ModelAssemblyLaser.java


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