Example usage for org.lwjgl.opengl GL11 glVertex3f

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

Introduction

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

Prototype

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

Source Link

Document

Specifies a single vertex between #glBegin Begin and #glEnd End by giving its coordinates in three dimensions.

Usage

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

License:Open Source License

@Override
public void Render(int x, int y) {
    GL11.glBegin(GL11.GL_QUADS);//from ww w.ja v  a 2 s  .c  o m

    // BOTTOM OF PILLAR
    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(-0.5f, -0.5f, -0.5f);
    GL11.glColor3f(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.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(-0.5f, -0.5f, 0f);
    GL11.glVertex3f(0.5f, -0.5f, 0f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(0.5f, -0.5f, -0.5f);
    GL11.glVertex3f(-0.5f, -0.5f, -0.5f);

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

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

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

    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(-0.3f, -0.3f, 0f);
    GL11.glVertex3f(0.3f, -0.3f, 0f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(0.3f, -0.3f, -4.5f);
    GL11.glVertex3f(-0.3f, -0.3f, -4.5f);

    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(0.3f, -0.3f, 0f);
    GL11.glVertex3f(0.3f, 0.3f, 0f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(0.3f, 0.3f, -4.5f);
    GL11.glVertex3f(0.3f, -0.3f, -4.5f);

    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(0.3f, 0.3f, 0f);
    GL11.glVertex3f(-0.3f, 0.3f, 0f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(-0.3f, 0.3f, -4.5f);
    GL11.glVertex3f(0.3f, 0.3f, -4.5f);

    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(-0.3f, 0.3f, 0f);
    GL11.glVertex3f(-0.3f, -0.3f, 0f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(-0.3f, -0.3f, -4.5f);
    GL11.glVertex3f(-0.3f, 0.3f, -4.5f);

    GL11.glColor3f(0.4f, 0.4f, 0.4f);
    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.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(-0.5f, -0.5f, -4.5f);
    GL11.glColor3f(0.5f, 0.5f, 0.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.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(-0.5f, -0.5f, -4f);
    GL11.glVertex3f(0.5f, -0.5f, -4f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(0.5f, -0.5f, -4.5f);
    GL11.glVertex3f(-0.5f, -0.5f, -4.5f);

    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(0.5f, -0.5f, -4f);
    GL11.glVertex3f(0.5f, 0.5f, -4f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(0.5f, 0.5f, -4.5f);
    GL11.glVertex3f(0.5f, -0.5f, -4.5f);

    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(0.5f, 0.5f, -4f);
    GL11.glVertex3f(-0.5f, 0.5f, -4f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(-0.5f, 0.5f, -4.5f);
    GL11.glVertex3f(0.5f, 0.5f, -4.5f);

    GL11.glColor3f(0.8f, 0.8f, 0.8f);
    GL11.glVertex3f(-0.5f, 0.5f, -4f);
    GL11.glVertex3f(-0.5f, -0.5f, -4f);
    GL11.glColor3f(0.5f, 0.5f, 0.5f);
    GL11.glVertex3f(-0.5f, -0.5f, -4.5f);
    GL11.glVertex3f(-0.5f, 0.5f, -4.5f);

    GL11.glEnd();

}

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  .  j  a  va2  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  .j ava  2s  .  co  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);/* www .  j av  a 2s .co  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);/* w ww  .  j  a  v  a2s .  c o  m*/
    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);//from  w  ww.j a  v a 2  s  .  c  o  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);/*from  w ww.  j ava2  s.c o  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);//from  w  ww.j  av a 2 s.  c  o  m
    GL11.glBegin(GL11.GL_TRIANGLES);

    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);//from w w  w .j  a v a  2  s . c  o  m
    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);

}

From source file:game.level.entities.mobs.enemies.Skeleton.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 ww  .  j a v  a 2 s  .com
    Color.white.bind();
    MobArt.Skeleton.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);

}