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


Java GL11.glRotated方法代码示例

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


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

示例1: applyDirection

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void applyDirection(EnumFacing direction) {
	int rotation = 0;
	switch (direction.getIndex()) {
	case 0:
		rotation = 270;
		break;
	case 1:
		rotation = 180;
		break;
	case 2:
		rotation = 90;
		break;
	case 3:
		rotation = 0;
		break;
	default:
		break;
	}
	GL11.glRotated(rotation, 0, 1, 0);
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:21,代码来源:PictureFrameTileRenderer.java

示例2: renderDynamic

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
protected void renderDynamic(float scale, float partialTicks) {
    shape1.render(scale);
    shape2.render(scale);

    float pressure = 0f;
    float dangerPressure = 5f;
    float critPressure = 7f;
    if (gaugeModule != null && gaugeModule.getTube() instanceof TileEntityPneumaticBase) {
        TileEntityPneumaticBase base = (TileEntityPneumaticBase) gaugeModule.getTube();
        pressure = base.getPressure();
        critPressure = base.criticalPressure;
        dangerPressure = base.dangerPressure;
    }
    GL11.glTranslated(0, 1, 0.378);
    double widgetScale = 0.007D;
    GL11.glScaled(widgetScale, widgetScale, widgetScale);
    GL11.glRotated(180, 0, 1, 0);
    GL11.glDisable(GL11.GL_LIGHTING);
    GuiUtils.drawPressureGauge(FMLClientHandler.instance().getClient().fontRenderer, -1, critPressure, dangerPressure, -1, pressure, 0, 0, 0);
    GL11.glEnable(GL11.GL_LIGHTING);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:23,代码来源:ModelGauge.java

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

示例4: rotateLocal

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void rotateLocal(float delta, int dim)
{
	GL11.glPushMatrix();
	GL11.glLoadIdentity();
	rotate();
	switch(dim)
	{
	case 0: GL11.glRotated(delta,1,0,0); break;
	case 1: GL11.glRotated(delta,0,1,0); break;
	case 2: GL11.glRotated(delta,0,0,1); break;
	}

	GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, rotationMatrix);
	updateRotationAnglesFromMatrix();
	GL11.glPopMatrix();
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:17,代码来源:PartRotation.java

示例5: drawTileEntityTags

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void drawTileEntityTags(){
    /* TILE ENTITIES */
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    for(Map.Entry<BlockPos, String> e : BLOCKS_NANO.entrySet()){
        GL11.glPushMatrix();
        double offX = (e.getKey().getX() + 0.5D);
        double offY = (e.getKey().getY() + 0.5D);
        double offZ = (e.getKey().getZ() + 0.5D);

        GL11.glTranslated(offX, offY, offZ);
        GL11.glRotated(-RENDER_MANAGER.playerViewY, 0.0, 1.0, 0.0);
        GL11.glRotated(RENDER_MANAGER.playerViewX, 1.0, 0.0, 0.0);
        /* Flip it! */
        GL11.glScaled(-0.015, -0.015, 0.015);


        FONT_RENDERER.drawString(e.getValue(), -FONT_RENDERER.getStringWidth(e.getValue()) / 2, 0, 0xCCCCCC /* GRAY */);

        GL11.glPopMatrix();
    }
    GL11.glDisable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:TerminatorNL,项目名称:LagGoggles,代码行数:23,代码来源:LagOverlayGui.java

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

示例7: rotateMatrixByMetadata

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Rotates the render matrix dependant on the given metadata of a block. Used in the render methods of many PneumaticCraft TileEntities.
 *
 * @param metadata block metadata
 * @return the angle (in degrees) of resulting rotation around the Y axis
 */
@SideOnly(Side.CLIENT)
public static double rotateMatrixByMetadata(int metadata) {
    EnumFacing facing = EnumFacing.getFront(metadata & 7);
    double metaRotation;
    switch (facing) {
        case UP:
            metaRotation = 0;
            GL11.glRotated(90, 1, 0, 0);
            GL11.glTranslated(0, -1, -1);
            break;
        case DOWN:
            metaRotation = 0;
            GL11.glRotated(-90, 1, 0, 0);
            GL11.glTranslated(0, -1, 1);
            break;
        case NORTH:
            metaRotation = 0;
            break;
        case EAST:
            metaRotation = 90;
            break;
        case SOUTH:
            metaRotation = 180;
            break;
        default:
            metaRotation = 270;
            break;
    }
    GL11.glRotated(metaRotation, 0, 1, 0);
    return metaRotation;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:38,代码来源:PneumaticCraftUtils.java

示例8: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(float partialTicks, double x1, double y1, double z1, double x2, double y2, double z2) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    TextureManager textureManager = mc.renderEngine;

    double laserLength = PneumaticCraftUtils.distBetween(x1, y1, z1, x2, y2, z2);
    double laserSize = 0.4;

    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.glTranslated(x1, y1, z1);

    double dx = x2 - x1;
    double dy = y2 - y1;
    double dz = z2 - z1;
    float f3 = MathHelper.sqrt(dx * dx + dz * dz);
    double rotYaw = Math.atan2(dx, dz) * 180.0D / Math.PI;
    double rotPitch = 90 - (float) (Math.atan2(dy, f3) * 180.0D / Math.PI);

    GL11.glRotated(rotYaw, 0, 1, 0);
    GL11.glRotated(rotPitch, 1, 0, 0);

    GL11.glScaled(laserSize, laserSize, laserSize);
    GL11.glTranslated(0, 0.6, 0);
    GL11.glRotated((ticksExisted + partialTicks) * 200, 0, 1, 0);

    GL11.glPushMatrix();
    GL11.glScaled(1, laserLength / laserSize, 1);

    /*   GL11.glTranslated(0, -0.01, 0);
       textureManager.bindTexture(Textures.RENDER_LASER_ANIMATION);
       renderAnimation(partialTicks, laserLength / laserSize);
       GL11.glTranslated(0, 0.01, 0);*/

    textureManager.bindTexture(Textures.RENDER_LASER);
    renderQuad(glowColor);
    textureManager.bindTexture(Textures.RENDER_LASER_OVERLAY);
    renderQuad(coreColor);
    GL11.glPopMatrix();

    GL11.glRotated(180, 1, 0, 0);
    textureManager.bindTexture(Textures.RENDER_LASER_START);
    renderQuad(glowColor);
    textureManager.bindTexture(Textures.RENDER_LASER_START_OVERLAY);
    renderQuad(coreColor);

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_LIGHTING);

    GL11.glColor4d(1, 1, 1, 1);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:55,代码来源:RenderLaser.java

示例9: renderMinigun

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void renderMinigun(Minigun minigun, float size, float partialTick, boolean renderMount) {
    Minecraft.getMinecraft().getTextureManager().bindTexture(Textures.MODEL_DRONE_MINIGUN);
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glPushMatrix();
    if (renderMount) {
        GL11.glTranslated(0, 5 / 16D, -12 / 16D);
        mount.render(size);
        GL11.glTranslated(0, -5 / 16D, 12 / 16D);
    }

    float barrelRotation = 0;
    if (minigun != null) {
        barrelRotation = (float) (minigun.getOldMinigunRotation() + partialTick * (minigun.getMinigunRotation() - minigun.getOldMinigunRotation()));
        double yaw = minigun.oldMinigunYaw + partialTick * (minigun.minigunYaw - minigun.oldMinigunYaw);
        double pitch = minigun.oldMinigunPitch + partialTick * (minigun.minigunPitch - minigun.oldMinigunPitch);

        GL11.glTranslated(0, 23 / 16D, 0);
        GL11.glRotated(yaw, 0, 1, 0);
        GL11.glRotated(pitch, 1, 0, 0);
        GL11.glTranslated(0, -18 / 16D, -12 / 16D);
    }
    barrel.rotateAngleY = 0;
    barrel.rotateAngleX = 0;
    for (int i = 0; i < 6; i++) {
        barrel.rotateAngleZ = (float) (Math.PI / 3 * i) + barrelRotation;
        barrel.render(size);
    }
    support1.rotateAngleZ = barrelRotation;
    support2.rotateAngleZ = barrelRotation;
    support3.rotateAngleZ = barrelRotation;
    support4.rotateAngleZ = barrelRotation;
    support5.rotateAngleZ = barrelRotation;
    support1.render(size);
    support2.render(size);
    support3.render(size);
    support4.render(size);
    support5.render(size);
    magazine.render(size);
    main.render(size);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    RenderUtils.glColorHex(minigun != null ? 0xFF000000 | minigun.getAmmoColor() : 0xFF313131);
    magazineColor.render(size);
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:47,代码来源:ModelDroneMinigun.java

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

示例11: renderModel

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void renderModel(float size, float rotation) {
    rotation++;
    GL11.glPushMatrix();
    GL11.glTranslated(0, 0, 3D / 16D);
    for (int i = 0; i < BLADE_COUNT; i++) {
        GL11.glPushMatrix();
        GL11.glRotated(rotation * 2 + (i + 0.5D) / BLADE_COUNT * 360, 0, 1, 0);
        GL11.glTranslated(0, 0, 1D / 16D);
        blade.render(size);
        GL11.glPopMatrix();
    }
    GL11.glPopMatrix();

    GL11.glRotated(180, 0, 1, 0);

    GL11.glPushMatrix();
    GL11.glTranslated(0, 0, 3D / 16D);
    for (int i = 0; i < BLADE_COUNT; i++) {
        GL11.glPushMatrix();
        GL11.glRotated(-rotation * 2 + (double) i / (double) BLADE_COUNT * 360, 0, 1, 0);
        GL11.glTranslated(0, 0, 1D / 16D);
        blade.render(size);
        GL11.glPopMatrix();
    }
    GL11.glPopMatrix();

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor4d(0.5D, 0.5D, 0.5D, 1.0D);
    GL11.glPushMatrix();
    for (int i = 0; i < CASE_POINTS; i++) {
        GL11.glPushMatrix();
        GL11.glTranslated(0, 0, 3F / 16F);
        GL11.glRotated((double) i / (double) CASE_POINTS * 275D - 130, 0, 1, 0);
        GL11.glTranslated(0, 0, 2.5F / 16F);
        turbineCase.render(size);
        GL11.glPopMatrix();
    }
    GL11.glRotated(180, 0, 1, 0);
    for (int i = 0; i < CASE_POINTS; i++) {
        GL11.glPushMatrix();
        GL11.glTranslated(0, 0, 3F / 16F);
        GL11.glRotated((double) i / (double) CASE_POINTS * 275D - 130, 0, 1, 0);
        GL11.glTranslated(0, 0, 2.5F / 16F);
        turbineCase.render(size);
        GL11.glPopMatrix();
    }
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4d(1, 1, 1, 0.4D);
    top.render(size);
    GL11.glDisable(GL11.GL_BLEND);

    drawPlusAndMinus();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:58,代码来源:ModelVacuumPump.java

示例12: rotate

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void rotate()
{
	GL11.glRotated(valueX/Math.PI*180F, 1, 0, 0);
	GL11.glRotated(valueY/Math.PI*180F, 0, 1, 0);
	GL11.glRotated(valueZ/Math.PI*180F, 0, 0, 1);
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:7,代码来源:PartRotation.java

示例13: rotate

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void rotate(double angle, double x, double y, double z) {
	GL11.glRotated(angle, x, y, z);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:4,代码来源:OpenGLHelper.java

示例14: drawEntityTags

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void drawEntityTags(float partialTicks){
    /* ENTITIES */
    for(Map.Entry<Entity, String> e : ENTITY_NANO.entrySet()){
        GL11.glPushMatrix();

        Entity entity = e.getKey();
        double pXe;
        double pYe;
        double pZe;

        if(entity.isDead) {
            pXe = entity.posX;
            pYe = entity.posY;
            pZe = entity.posZ;
        }else{
            pXe = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks;
            pYe = entity.prevPosY + (entity.posY - entity.prevPosY) * partialTicks;
            pZe = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;
        }

        GL11.glTranslated(pXe, pYe + 2.3D, pZe);
        GL11.glRotated(-RENDER_MANAGER.playerViewY, 0.0, 1.0, 0.0);
        GL11.glRotated(RENDER_MANAGER.playerViewX, 1.0, 0.0, 0.0);
        /* Flip it! */
        GL11.glScaled(-0.015, -0.015, 0.015);


        double[] c = Graphical.heatToColor(ENTITY_HEAT.get(entity));
        GL11.glColor4d(c[0],c[1],c[2], 0.6);


        GL11.glBegin(GL11.GL_QUADS);
        String text = e.getValue();
        if(entity.isDead){
            text = text + " (" + entity.getName() + ")";
        }
        int width_plus_2 = FONT_RENDERER.getStringWidth(text) + 2;
        int height_div_2_plus_1 = (FONT_RENDERER.FONT_HEIGHT/2) + 1;
        GL11.glVertex3d(0           ,-height_div_2_plus_1,0);
        GL11.glVertex3d(0           , height_div_2_plus_1 - 1,0);
        GL11.glVertex3d(width_plus_2, height_div_2_plus_1 - 1,0);
        GL11.glVertex3d(width_plus_2,-height_div_2_plus_1,0);
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glColor4d(0,0,0,1);

        FONT_RENDERER.drawString(text, 1, -FONT_RENDERER.FONT_HEIGHT/2, 0x000000);

        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glPopMatrix();
    }
}
 
开发者ID:TerminatorNL,项目名称:LagGoggles,代码行数:53,代码来源:LagOverlayGui.java


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