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:io.flob.blackheart.IDoor.java

License:Open Source License

private void render_surround() {
    // Bottom/*from w  ww  .ja v a 2  s . co  m*/
    GL11.glNormal3f(0, -1, 0);
    GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV());
    GL11.glVertex3f(-size + position_start.getX(), -size + position_start.getY() + Level.texture_bleed_offset,
            -size + position_start.getZ());
    GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV());
    GL11.glVertex3f(size + position_start.getX(), -size + position_start.getY() + Level.texture_bleed_offset,
            -size + position_start.getZ());
    GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV2());
    GL11.glVertex3f(size + position_start.getX(), -size + position_start.getY() + Level.texture_bleed_offset,
            size + position_start.getZ());
    GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV2());
    GL11.glVertex3f(-size + position_start.getX(), -size + position_start.getY() + Level.texture_bleed_offset,
            size + position_start.getZ());

    // Top
    GL11.glNormal3f(0, 1, 0);
    GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV());
    GL11.glVertex3f(-size + position_start.getX(), size + position_start.getY() - Level.texture_bleed_offset,
            -size + position_start.getZ());
    GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV2());
    GL11.glVertex3f(-size + position_start.getX(), size + position_start.getY() - Level.texture_bleed_offset,
            size + position_start.getZ());
    GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV2());
    GL11.glVertex3f(size + position_start.getX(), size + position_start.getY() - Level.texture_bleed_offset,
            size + position_start.getZ());
    GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV());
    GL11.glVertex3f(size + position_start.getX(), size + position_start.getY() - Level.texture_bleed_offset,
            -size + position_start.getZ());

    if (parallel) {
        // right 
        GL11.glNormal3f(1, 0, 0);
        GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV2());
        GL11.glVertex3f(size + position_start.getX() - Level.texture_bleed_offset,
                -size + position_start.getY(), -size + position_start.getZ());
        GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV());
        GL11.glVertex3f(size + position_start.getX() - Level.texture_bleed_offset, size + position_start.getY(),
                -size + position_start.getZ());
        GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV());
        GL11.glVertex3f(size + position_start.getX() - Level.texture_bleed_offset, size + position_start.getY(),
                size + position_start.getZ());
        GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV2());
        GL11.glVertex3f(size + position_start.getX() - Level.texture_bleed_offset,
                -size + position_start.getY(), size + position_start.getZ());
    } else {
        // back
        GL11.glNormal3f(0f, 0f, -1f);
        GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV2());
        GL11.glVertex3f(-size + position_start.getX(), -size + position_start.getY(),
                -size + position_start.getZ() + Level.texture_bleed_offset);
        GL11.glTexCoord2f(texture_surround.getU2(), texture_surround.getV());
        GL11.glVertex3f(-size + position_start.getX(), size + position_start.getY(),
                -size + position_start.getZ() + Level.texture_bleed_offset);
        GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV());
        GL11.glVertex3f(size + position_start.getX(), size + position_start.getY(),
                -size + position_start.getZ() + Level.texture_bleed_offset);
        GL11.glTexCoord2f(texture_surround.getU(), texture_surround.getV2());
        GL11.glVertex3f(size + position_start.getX(), -size + position_start.getY(),
                -size + position_start.getZ() + Level.texture_bleed_offset);
    }
}

From source file:io.flob.blackheart.IWall.java

License:Open Source License

private void render_front() {
    if (texture_front == null) {
        texture_front = TextureLibrary.placeholder;
    }/* w  w w  . j  a  v  a 2  s .  com*/
    GL11.glNormal3f(0f, 0f, 1f);
    GL11.glTexCoord2f(texture_front.getU(), texture_front.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture_front.getU2(), texture_front.getV2());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture_front.getU2(), texture_front.getV());
    GL11.glVertex3f(size + position.getX(), size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture_front.getU(), texture_front.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), size + position.getZ());
}

From source file:io.flob.blackheart.IWall.java

License:Open Source License

private void render_back() {
    if (texture_back == null) {
        texture_back = TextureLibrary.placeholder;
    }//  w  w w  .j a  v  a2s.  c  o m
    GL11.glNormal3f(0f, 0f, -1f);
    GL11.glTexCoord2f(texture_back.getU2(), texture_back.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_back.getU2(), texture_back.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_back.getU(), texture_back.getV());
    GL11.glVertex3f(size + position.getX(), size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_back.getU(), texture_back.getV2());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), -size + position.getZ());
}

From source file:io.flob.blackheart.IWall.java

License:Open Source License

private void render_left() {
    if (texture_left == null) {
        texture_left = TextureLibrary.placeholder;
    }//from   w  ww .j  a v a  2s  . c  o  m
    GL11.glNormal3f(-1, 0, 0);
    GL11.glTexCoord2f(texture_left.getU(), texture_left.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_left.getU2(), texture_left.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture_left.getU2(), texture_left.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture_left.getU(), texture_left.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), -size + position.getZ());
}

From source file:io.flob.blackheart.IWall.java

License:Open Source License

private void render_right() {
    if (texture_right == null) {
        texture_right = TextureLibrary.placeholder;
    }/* w ww .  j av a2 s .  co  m*/
    GL11.glNormal3f(1, 0, 0);
    GL11.glTexCoord2f(texture_right.getU2(), texture_right.getV2());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_right.getU2(), texture_right.getV());
    GL11.glVertex3f(size + position.getX(), size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_right.getU(), texture_right.getV());
    GL11.glVertex3f(size + position.getX(), size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture_right.getU(), texture_right.getV2());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), size + position.getZ());
}

From source file:io.flob.blackheart.IWallSecret.java

License:Open Source License

private void render_bottom() {
    if (texture_bottom == null) {
        texture_bottom = TextureLibrary.placeholder;
    }/*ww  w  . j  ava 2  s.  c o m*/
    GL11.glNormal3f(0, -1, 0);
    GL11.glTexCoord2f(texture_bottom.getU2(), texture_bottom.getV());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_bottom.getU(), texture_bottom.getV());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture_bottom.getU(), texture_bottom.getV2());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture_bottom.getU2(), texture_bottom.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), size + position.getZ());
}

From source file:io.flob.blackheart.IWindow.java

License:Open Source License

@Override
public void _render() {
    if (texture == null) {
        texture = TextureLibrary.placeholder;
    }/* ww  w  .  ja  v a  2 s .  c om*/
    if (parallel) {
        GL11.glNormal3f(0f, 0f, 1f);
        GL11.glTexCoord2f(texture.getU(), texture.getV2());
        GL11.glVertex3f(-size + position.getX(), -size + position.getY(), position.getZ());
        GL11.glTexCoord2f(texture.getU2(), texture.getV2());
        GL11.glVertex3f(size + position.getX(), -size + position.getY(), position.getZ());
        GL11.glTexCoord2f(texture.getU2(), texture.getV());
        GL11.glVertex3f(size + position.getX(), size + position.getY(), position.getZ());
        GL11.glTexCoord2f(texture.getU(), texture.getV());
        GL11.glVertex3f(-size + position.getX(), size + position.getY(), position.getZ());
    } else {
        GL11.glNormal3f(-1, 0, 0);
        GL11.glTexCoord2f(texture.getU(), texture.getV2());
        GL11.glVertex3f(position.getX(), -size + position.getY(), -size + position.getZ());
        GL11.glTexCoord2f(texture.getU2(), texture.getV2());
        GL11.glVertex3f(position.getX(), -size + position.getY(), size + position.getZ());
        GL11.glTexCoord2f(texture.getU2(), texture.getV());
        GL11.glVertex3f(position.getX(), size + position.getY(), size + position.getZ());
        GL11.glTexCoord2f(texture.getU(), texture.getV());
        GL11.glVertex3f(position.getX(), size + position.getY(), -size + position.getZ());
    }
}

From source file:io.flob.blackheart.WallLiftPanel.java

License:Open Source License

private void render_front() {
    GL11.glNormal3f(0f, 0f, 1f);//from w ww . j  a v a2  s  . c  o  m
    GL11.glTexCoord2f(texture.getU(), texture.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture.getU2(), texture.getV2());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture.getU2(), texture.getV());
    GL11.glVertex3f(size + position.getX(), size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture.getU(), texture.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), size + position.getZ());
}

From source file:io.flob.blackheart.WallLiftPanel.java

License:Open Source License

private void render_back() {
    GL11.glNormal3f(0f, 0f, -1f);//from  www  .  ja va  2 s  .c o m
    GL11.glTexCoord2f(texture.getU2(), texture.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture.getU2(), texture.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture.getU(), texture.getV());
    GL11.glVertex3f(size + position.getX(), size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture.getU(), texture.getV2());
    GL11.glVertex3f(size + position.getX(), -size + position.getY(), -size + position.getZ());
}

From source file:io.flob.blackheart.WallLiftPanel.java

License:Open Source License

private void render_left() {
    GL11.glNormal3f(-1, 0, 0);/*ww w .ja  v a  2 s. c  om*/
    GL11.glTexCoord2f(texture.getU(), texture.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), -size + position.getZ());
    GL11.glTexCoord2f(texture.getU2(), texture.getV2());
    GL11.glVertex3f(-size + position.getX(), -size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture.getU2(), texture.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), size + position.getZ());
    GL11.glTexCoord2f(texture.getU(), texture.getV());
    GL11.glVertex3f(-size + position.getX(), size + position.getY(), -size + position.getZ());
}