List of usage examples for org.lwjgl.opengl GL11 glTexCoord2f
public static native void glTexCoord2f(@NativeType("GLfloat") float s, @NativeType("GLfloat") float t);
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 ww . j a v a 2 s. 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 www . jav a2s . 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 . jav a 2s . 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.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 va2 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 w w . j a va 2s .c o m*/ 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); }
From source file:game.level.entities.mobs.enemies.Vampire.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 . c o m Color.white.bind(); MobArt.Vampire.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.Werewolf.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 www . j a v a 2s . c o m*/ Color.white.bind(); MobArt.Werewolf.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.Zombie.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 a va2 s . co m Color.white.bind(); MobArt.Zombie.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.player.Inventory.java
License:Open Source License
private void RenderSelectedTexture(int x, int y) { ItemArt.SelectedIcon.bind();/*from ww w . ja v a 2 s.c om*/ GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2f(0, 0); GL11.glVertex3f(x, y, 0); GL11.glTexCoord2f(0, 1); GL11.glVertex3f(x, y + WidthRef, 0); GL11.glTexCoord2f(1, 1); GL11.glVertex3f(x + WidthRef, y + WidthRef, 0); GL11.glTexCoord2f(1, 0); GL11.glVertex3f(x + WidthRef, y, 0); GL11.glEnd(); }
From source file:game.level.entities.mobs.player.items.EquipableItem.java
License:Open Source License
@Override public void Render(int ScreenX, int ScreenY) { ItemArt.Equipables.bind();//from www . ja v a 2s . c o m GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2f(TEXTURE_QUAD_XLENGTH * XTextureRef, TEXTURE_QUAD_YLENGTH * YTextureRef); GL11.glVertex3f(ScreenX, ScreenY, 0); GL11.glTexCoord2f(TEXTURE_QUAD_XLENGTH * XTextureRef, TEXTURE_QUAD_YLENGTH * (YTextureRef + 1)); GL11.glVertex3f(ScreenX, ScreenY + IconWidth, 0); GL11.glTexCoord2f(TEXTURE_QUAD_XLENGTH * (XTextureRef + 1), TEXTURE_QUAD_YLENGTH * (YTextureRef + 1)); GL11.glVertex3f(ScreenX + IconWidth, ScreenY + IconWidth, 0); GL11.glTexCoord2f(TEXTURE_QUAD_XLENGTH * (XTextureRef + 1), TEXTURE_QUAD_YLENGTH * YTextureRef); GL11.glVertex3f(ScreenX + IconWidth, ScreenY, 0); GL11.glEnd(); }