Example usage for org.lwjgl.opengl GL11 glRotatef

List of usage examples for org.lwjgl.opengl GL11 glRotatef

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glRotatef.

Prototype

public static native void glRotatef(@NativeType("GLfloat") float angle, @NativeType("GLfloat") float x,
        @NativeType("GLfloat") float y, @NativeType("GLfloat") float z);

Source Link

Document

Manipulates the current matrix with a rotation matrix.

Usage

From source file:fr.wolf.addons.client.render.TESRCable.java

License:Minecraft Mod Public

private void renderDirectional(EnumFacing direction) {
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.startDrawingQuads();/*from  w ww.  j  a v a  2  s  .c  o m*/
    {
        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
        switch (direction) {
        case NORTH:
            GL11.glRotatef(270F, 1F, 0F, 0F);
            break;
        case SOUTH:
            GL11.glRotatef(90F, 1F, 0F, 0F);
            break;
        case WEST:
            GL11.glRotatef(90F, 0F, 0F, 1F);
            break;
        case EAST:
            GL11.glRotatef(270F, 0F, 0F, 1F);
            break;
        case UP:
            break;
        case DOWN:
            GL11.glRotatef(180F, 1F, 0F, 0F);
            break;
        }
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2,
                5 * pixel_texture, 5 * pixel_texture);
        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                5 * pixel_texture);
        worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                0 * pixel_texture);
        worldrenderer.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * pixel_texture,
                0 * pixel_texture);

        worldrenderer.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * pixel_texture,
                5 * pixel_texture);
        worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture, 5 * pixel_texture);
        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture,
                0 * pixel_texture);
        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * pixel_texture,
                0 * pixel_texture);

        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * pixel_texture,
                5 * pixel_texture);
        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture,
                5 * pixel_texture);
        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                0 * pixel_texture);
        worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2,
                5 * pixel_texture, 0 * pixel_texture);

        worldrenderer.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * pixel_texture,
                5 * pixel_texture);
        worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                5 * pixel_texture);
        worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture, 0 * pixel_texture);
        worldrenderer.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * pixel_texture,
                0 * pixel_texture);

        if (drawInside) {
            worldrenderer.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * pixel_texture,
                    0 * pixel_texture);
            worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                    0 * pixel_texture);
            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                    5 * pixel_texture);
            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2,
                    5 * pixel_texture, 5 * pixel_texture);

            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2,
                    5 * pixel_texture, 0 * pixel_texture);
            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture,
                    0 * pixel_texture);
            worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture,
                    5 * pixel_texture);
            worldrenderer.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * pixel_texture,
                    5 * pixel_texture);

            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2,
                    5 * pixel_texture, 0 * pixel_texture);
            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                    0 * pixel_texture);
            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture,
                    5 * pixel_texture);
            worldrenderer.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2,
                    5 * pixel_texture, 5 * pixel_texture);

            worldrenderer.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * pixel_texture,
                    0 * pixel_texture);
            worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * pixel_texture,
                    0 * pixel_texture);
            worldrenderer.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * pixel_texture,
                    5 * pixel_texture);
            worldrenderer.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2,
                    5 * pixel_texture, 5 * pixel_texture);
        }
    }
    tessellator.draw();

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    switch (direction) {
    case NORTH:
        GL11.glRotatef(-270F, 1F, 0F, 0F);
        break;
    case SOUTH:
        GL11.glRotatef(-90F, 1F, 0F, 0F);
        break;
    case WEST:
        GL11.glRotatef(-90F, 0F, 0F, 1F);
        break;
    case EAST:
        GL11.glRotatef(-270F, 0F, 0F, 1F);
        break;
    case UP:
        break;
    case DOWN:
        GL11.glRotatef(-180F, 1F, 0F, 0F);
        break;
    }
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
}

From source file:fractal.PolygonFractal.java

public void next(int depth, double angle) {
    GL11.glRotatef((float) angle, 0, 0, 1);

    float sector = 2f * (float) Math.PI / (float) num_verts;

    /*GL11.glColor3f((float)Math.sin(color_basis) / 2f + 0.5f, 
               (float)Math.sin(color_basis + Math.PI / 1.5) / 2f + 0.5f,
               (float)Math.sin(color_basis + Math.PI / 0.75) / 2f + 0.5f);*/
    GL11.glBegin(GL11.GL_LINE_STRIP);//from   ww w  . ja  va  2 s  .  c o m
    for (int i = 0; i <= num_verts; i++) {
        float a = sector * i;
        GL11.glVertex2f((float) Math.cos(a), (float) Math.sin(a));
    }
    GL11.glEnd();

    if (depth > 0) {
        for (int i = 0; i < num_verts; i++) {
            GL11.glRotatef(sector * 180f / (float) Math.PI, 0, 0, 1);
            GL11.glPushMatrix();
            GL11.glTranslatef(1, 0, 0);
            GL11.glScalef(mult, mult, mult);

            next(depth - 1, angle * ang_mult);
            GL11.glPopMatrix();
        }
    }
}

From source file:game.level.entities.furniture.Portal.java

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glRotatef(YawRotation, 0, 0, 1);
    GL11.glBegin(GL11.GL_LINE_LOOP);/*from  w w  w .  ja v  a2 s.c  o m*/

    if (Direction > 0) {
        GL11.glColor3f(139f / 256f, 34f / 256f, 82f / 256f);
    } else {
        GL11.glColor3f(224f / 256f, 102f / 256f, 255f / 256f);
    }
    GL11.glVertex3f(-0.5f, -0.5f, -0.5f);

    GL11.glVertex3f(0.5f, -0.5f, -0.5f);
    GL11.glVertex3f(0.5f, 0.5f, -0.5f);
    GL11.glVertex3f(-0.5f, 0.5f, -0.5f);

    GL11.glVertex3f(-0.5f, -0.5f, 0f);
    GL11.glVertex3f(0.5f, -0.5f, 0f);

    GL11.glVertex3f(0.5f, -0.5f, -0.5f);
    GL11.glVertex3f(-0.5f, -0.5f, -0.5f);

    GL11.glVertex3f(0.5f, -0.5f, 0f);
    GL11.glVertex3f(0.5f, 0.5f, 0f);

    GL11.glVertex3f(0.5f, 0.5f, -0.5f);
    GL11.glVertex3f(0.5f, -0.5f, -0.5f);

    GL11.glVertex3f(0.5f, 0.5f, 0f);
    GL11.glVertex3f(-0.5f, 0.5f, 0f);

    GL11.glVertex3f(-0.5f, 0.5f, -0.5f);
    GL11.glVertex3f(0.5f, 0.5f, -0.5f);

    GL11.glVertex3f(-0.5f, 0.5f, 0f);
    GL11.glVertex3f(-0.5f, -0.5f, 0f);

    GL11.glVertex3f(-0.5f, -0.5f, -0.5f);
    GL11.glVertex3f(-0.5f, 0.5f, -0.5f);

    GL11.glVertex3f(-0.3f, -0.3f, 0f);
    GL11.glVertex3f(0.3f, -0.3f, 0f);

    GL11.glVertex3f(0.3f, -0.3f, -4.5f);
    GL11.glVertex3f(-0.3f, -0.3f, -4.5f);

    GL11.glVertex3f(0.3f, -0.3f, 0f);
    GL11.glVertex3f(0.3f, 0.3f, 0f);

    GL11.glVertex3f(0.3f, 0.3f, -4.5f);
    GL11.glVertex3f(0.3f, -0.3f, -4.5f);

    GL11.glVertex3f(0.3f, 0.3f, 0f);
    GL11.glVertex3f(-0.3f, 0.3f, 0f);

    GL11.glVertex3f(-0.3f, 0.3f, -4.5f);
    GL11.glVertex3f(0.3f, 0.3f, -4.5f);

    GL11.glVertex3f(-0.3f, 0.3f, 0f);
    GL11.glVertex3f(-0.3f, -0.3f, 0f);

    GL11.glVertex3f(-0.3f, -0.3f, -4.5f);
    GL11.glVertex3f(-0.3f, 0.3f, -4.5f);

    GL11.glVertex3f(-0.3f, -0.3f, -4.5f);
    GL11.glVertex3f(0.3f, -0.3f, -4.5f);
    GL11.glVertex3f(0.3f, 0.3f, -4.5f);
    GL11.glVertex3f(-0.3f, 0.3f, -4.5f);

    // TOP OF PILLAR

    GL11.glVertex3f(-0.5f, -0.5f, -4.5f);

    GL11.glVertex3f(0.5f, -0.5f, -4.5f);
    GL11.glVertex3f(0.5f, 0.5f, -4.5f);
    GL11.glVertex3f(-0.5f, 0.5f, -4.5f);

    GL11.glVertex3f(-0.5f, -0.5f, -4f);
    GL11.glVertex3f(0.5f, -0.5f, -4f);

    GL11.glVertex3f(0.5f, -0.5f, -4.5f);
    GL11.glVertex3f(-0.5f, -0.5f, -4.5f);

    GL11.glVertex3f(0.5f, -0.5f, -4f);
    GL11.glVertex3f(0.5f, 0.5f, -4f);

    GL11.glVertex3f(0.5f, 0.5f, -4.5f);
    GL11.glVertex3f(0.5f, -0.5f, -4.5f);

    GL11.glVertex3f(0.5f, 0.5f, -4f);
    GL11.glVertex3f(-0.5f, 0.5f, -4f);

    GL11.glVertex3f(-0.5f, 0.5f, -4.5f);
    GL11.glVertex3f(0.5f, 0.5f, -4.5f);

    GL11.glVertex3f(-0.5f, 0.5f, -4f);
    GL11.glVertex3f(-0.5f, -0.5f, -4f);

    GL11.glVertex3f(-0.5f, -0.5f, -4.5f);
    GL11.glVertex3f(-0.5f, 0.5f, -4.5f);

    GL11.glEnd();
    GL11.glRotatef(-YawRotation, 0, 0, 1);
    YawRotation += 12;
}

From source file:game.level.entities.mobs.enemies.Bandit.java

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glRotatef(Facing * 90f, 0f, 0f, 1f);
    GL11.glEnable(GL11.GL_TEXTURE_2D);/*from  ww w.java2  s.c  o  m*/
    Color.white.bind();
    MobArt.Bandit.bind();
    GL11.glBegin(GL11.GL_QUADS);

    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    GL11.glTexCoord2f(0, 1);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    GL11.glTexCoord2f(1, 1);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    GL11.glTexCoord2f(1, 0);
    GL11.glVertex3f(-0.3f, 0.3f, 0);

    // Topwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(18 / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Top left
    GL11.glTexCoord2f(18f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);

    // Rightwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom Right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Front
    // Bottom left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);

    // Top right
    GL11.glTexCoord2f(18f / 64f, 0);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);

    // Leftwards Side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    // TOP
    // Top right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);
    // Bottom left
    GL11.glTexCoord2f(0, 64f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 64f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    GL11.glEnd();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBegin(GL11.GL_QUADS);
    RenderHealthBar();
    GL11.glEnd();
    GL11.glRotatef(Facing * -90f, 0f, 0f, 1f);

}

From source file:game.level.entities.mobs.enemies.Demon.java

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glRotatef(Facing * 90f, 0f, 0f, 1f);
    GL11.glEnable(GL11.GL_TEXTURE_2D);//  w  w  w  . j  a  v  a2  s.c o  m
    Color.white.bind();
    MobArt.Demon.bind();
    GL11.glBegin(GL11.GL_QUADS);

    // Topwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(18 / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Top left
    GL11.glTexCoord2f(18f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);

    // Rightwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom Right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Front
    // Bottom left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);

    // Top right
    GL11.glTexCoord2f(18f / 64f, 0);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);

    // Leftwards Side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    // TOP
    // Top right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);
    // Bottom left
    GL11.glTexCoord2f(0, 64f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 64f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    GL11.glEnd();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBegin(GL11.GL_QUADS);
    RenderHealthBar();
    GL11.glEnd();
    GL11.glRotatef(Facing * -90f, 0f, 0f, 1f);

}

From source file:game.level.entities.mobs.enemies.Dwarf.java

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glRotatef(Facing * 90f, 0f, 0f, 1f);
    GL11.glEnable(GL11.GL_TEXTURE_2D);/*from  w  w  w.  j  ava 2  s  .  com*/
    Color.white.bind();
    MobArt.Dwarf.bind();
    GL11.glBegin(GL11.GL_QUADS);

    // Topwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(18 / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Top left
    GL11.glTexCoord2f(18f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);

    // Rightwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom Right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Front
    // Bottom left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);

    // Top right
    GL11.glTexCoord2f(18f / 64f, 0);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);

    // Leftwards Side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    // TOP
    // Top right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);
    // Bottom left
    GL11.glTexCoord2f(0, 64f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 64f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    GL11.glEnd();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBegin(GL11.GL_QUADS);
    RenderHealthBar();
    GL11.glEnd();
    GL11.glRotatef(Facing * -90f, 0f, 0f, 1f);

}

From source file:game.level.entities.mobs.enemies.Ghost.java

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glRotatef(Facing * 90f, 0f, 0f, 1f);
    GL11.glEnable(GL11.GL_TEXTURE_2D);// w w w . ja va  2s.  co  m
    Color.white.bind();
    MobArt.Ghost.bind();
    GL11.glBegin(GL11.GL_QUADS);

    // Topwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(18 / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Top left
    GL11.glTexCoord2f(18f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);

    // Rightwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom Right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Front
    // Bottom left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);

    // Top right
    GL11.glTexCoord2f(18f / 64f, 0);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);

    // Leftwards Side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    // TOP
    // Top right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);
    // Bottom left
    GL11.glTexCoord2f(0, 64f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 64f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    GL11.glEnd();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBegin(GL11.GL_QUADS);
    RenderHealthBar();
    GL11.glEnd();
    GL11.glRotatef(Facing * -90f, 0f, 0f, 1f);

}

From source file:game.level.entities.mobs.enemies.Lich.java

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glRotatef(Facing * 90f, 0f, 0f, 1f);
    GL11.glEnable(GL11.GL_TEXTURE_2D);/*w w w . ja  v  a  2s.co  m*/
    Color.white.bind();
    MobArt.Lich.bind();
    GL11.glBegin(GL11.GL_QUADS);

    // Topwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(18 / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Top left
    GL11.glTexCoord2f(18f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);

    // Rightwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom Right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Front
    // Bottom left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);

    // Top right
    GL11.glTexCoord2f(18f / 64f, 0);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);

    // Leftwards Side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    // TOP
    // Top right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);
    // Bottom left
    GL11.glTexCoord2f(0, 64f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 64f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    GL11.glEnd();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBegin(GL11.GL_QUADS);
    RenderHealthBar();

    GL11.glEnd();
    GL11.glRotatef(Facing * -90f, 0f, 0f, 1f);
    RenderCrystal(1, 1);
    RenderCrystal(1, 80);
    RenderCrystal(1, 170);

}

From source file:game.level.entities.mobs.enemies.Lich.java

License:Open Source License

private void RenderCrystal(int i, int j) {
    GL11.glTranslated(Math.cos((YawRotate + j) / 180 * Math.PI) * i,
            Math.sin((YawRotate + j) / 180f * Math.PI) * i, 0);
    GL11.glRotatef(YawRotate, 0, 0, 1);
    GL11.glBegin(GL11.GL_TRIANGLES);/*  ww w . j a  va2 s. c  om*/

    GL11.glColor3f(0, 0, 1);
    GL11.glVertex3f(+0.1f, -0.1f, -0.1f);
    GL11.glVertex3f(-0.1f, -0.1f, -0.1f);
    GL11.glColor3f(1, 1, 1);
    GL11.glVertex3f(0, 0, -1f);

    GL11.glColor3f(0, 0, 1);
    GL11.glVertex3f(-0.1f, -0.1f, -0.1f);
    GL11.glVertex3f(0, +0.1f, -0.1f);
    GL11.glColor3f(1, 1, 1);
    GL11.glVertex3f(0, 0, -1f);

    GL11.glColor3f(0, 0, 1);
    GL11.glVertex3f(0, +0.1f, -0.1f);
    GL11.glVertex3f(+0.1f, -0.1f, -0.1f);
    GL11.glColor3f(1, 1, 1);
    GL11.glVertex3f(0, 0, -1f);

    GL11.glEnd();

    GL11.glRotatef(-YawRotate, 0, 0, 1);
    GL11.glTranslated(-Math.cos((YawRotate + j) / 180 * Math.PI) * i,
            -Math.sin((YawRotate + j) / 180f * Math.PI) * i, 0);
    YawRotate += 8;

}

From source file:game.level.entities.mobs.enemies.Orc.java

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glRotatef(Facing * 90f, 0f, 0f, 1f);
    GL11.glEnable(GL11.GL_TEXTURE_2D);//w w w .j a va2s . c om
    Color.white.bind();
    MobArt.Orc.bind();
    GL11.glBegin(GL11.GL_QUADS);

    // Topwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(18 / 64f, 36f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Top left
    GL11.glTexCoord2f(18f / 64f, 18f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);

    // Rightwards side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, 0);
    // Bottom Right
    GL11.glTexCoord2f(64f / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 18f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 0f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);

    // Front
    // Bottom left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);

    // Top right
    GL11.glTexCoord2f(18f / 64f, 0);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);

    // Leftwards Side
    // Top right
    GL11.glTexCoord2f(64f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, 0);
    // Bottom left+Right
    GL11.glTexCoord2f(64f / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, 0);
    // Bottom left
    GL11.glTexCoord2f(19 / 64f, 54f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(19f / 64f, 37f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    // TOP
    // Top right
    GL11.glTexCoord2f(18f / 64f, 46f / 64f);
    GL11.glVertex3f(-0.3f, -0.3f, -MOB_HEIGHT);
    // Top left
    GL11.glTexCoord2f(0, 46f / 64f);
    GL11.glVertex3f(0.3f, -0.3f, -MOB_HEIGHT);
    // Bottom left
    GL11.glTexCoord2f(0, 64f / 64f);
    GL11.glVertex3f(0.3f, 0.3f, -MOB_HEIGHT);
    // Bottom left+Right
    GL11.glTexCoord2f(18f / 64f, 64f / 64f);
    GL11.glVertex3f(-0.3f, 0.3f, -MOB_HEIGHT);

    GL11.glEnd();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBegin(GL11.GL_QUADS);
    RenderHealthBar();
    GL11.glEnd();
    GL11.glRotatef(Facing * -90f, 0f, 0f, 1f);

}