Example usage for org.lwjgl.opengl GL11 glNormal3f

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

Introduction

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

Prototype

public static native void glNormal3f(@NativeType("GLfloat") float nx, @NativeType("GLfloat") float ny,
        @NativeType("GLfloat") float nz);

Source Link

Document

Sets the current normal.

Usage

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

License:Open Source License

private void render_front() {
    if (texture_front == null) {
        texture_front = TextureLibrary.placeholder;
    }//from   w  w  w. ja  va  2  s  .c  o  m
    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;
    }/*from   www. j a  v a  2 s  . co 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 w  w.  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;
    }//from   w w  w  .j  a va  2  s  .c om
    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;
    }/* w  w  w .jav  a 2 s  .  co  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;
    }/*from   w  w  w  .java 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.MobMachinegun.java

License:Open Source License

@Override
public void _render() {
    GL11.glEnd();/*  w  w w  .j  a  v  a 2s  . co m*/

    float size_x = size().getX() / 2f;
    float size_y = size().getY() / 2f + 0.025f; // HARD SET!
    GL11.glPushMatrix();
    GL11.glTranslatef(position().getX(), position().getY(), position().getZ());
    FloatBuffer modelview = BufferUtils.createFloatBuffer(16);
    GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview);
    for (int i = 0; i < 3; i += 2) {
        for (int j = 0; j < 3; j++) {
            if (i == j) {
                modelview.put(i * 4 + j, 1.0f);
            } else {
                modelview.put(i * 4 + j, 0.0f);
            }
        }
    }
    GL11.glLoadMatrix(modelview);
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glNormal3f(0f, 0f, 1f);
    GL11.glTexCoord2f(texture[state].getU(), texture[state].getV2());
    GL11.glVertex2f(-size_x, -size_y);
    GL11.glTexCoord2f(texture[state].getU2(), texture[state].getV2());
    GL11.glVertex2f(size_x, -size_y);
    GL11.glTexCoord2f(texture[state].getU2(), texture[state].getV());
    GL11.glVertex2f(size_x, size_y);
    GL11.glTexCoord2f(texture[state].getU(), texture[state].getV());
    GL11.glVertex2f(-size_x, size_y);
    GL11.glEnd();
    GL11.glPopMatrix();

    GL11.glBegin(GL11.GL_QUADS);
}

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

License:Open Source License

private void render_front() {
    GL11.glNormal3f(0f, 0f, 1f);
    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);
    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);
    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());
}