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:src.graphics.cutout.ImageSprite.java

License:Open Source License

public void renderTo(Rendering rendering) {
    ////from  w  w  w .  j  a  v a  2 s .  c o  m
    //  Since we've disabled normal lighting, we have to 'fake it' using colour
    //  parameters:
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
    final Colour c = colour == null ? Colour.WHITE : colour;
    if (c.a < 0) {
        GL11.glColor4f(c.r, c.g, c.b, 0 - c.a);
    } else {
        final Lighting l = rendering.lighting;
        GL11.glColor4f(c.r * fog * l.r(), c.g * fog * l.g(), c.b * fog * l.b(), c.a);
    }
    //
    //  Obtain the correct set of UV coordinates for the current frame-
    model.texture.bindTex();
    final float framesUV[][] = model.framesUV();
    final float texUV[] = framesUV[(int) animProgress];
    //
    //  TODO:  Consider replacing this with an aggregate method within the
    //  MeshBuffer class?  Re-implement RenderPass, in other words.
    GL11.glBegin(GL11.GL_TRIANGLES);
    int tI = 0;
    for (Vec3D vert : model.coords) {
        GL11.glTexCoord2f(texUV[tI++], texUV[tI++]);
        GL11.glVertex3f(position.x + (vert.x * scale), position.y + (vert.y * scale),
                position.z + (vert.z * scale));
    }
    GL11.glEnd();
}

From source file:src.graphics.sfx.SFX.java

License:Open Source License

protected void renderTex(Vec3D[] verts, Texture tex) {
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();//from  ww  w  .j  a  v  a  2s. c  o m
    tex.bindTex();
    Vec3D v;
    GL11.glDepthMask(false);
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glTexCoord2f(0, 0);
    v = verts[0];
    GL11.glVertex3f(v.x, v.y, v.z);
    GL11.glTexCoord2f(0, 1);
    v = verts[1];
    GL11.glVertex3f(v.x, v.y, v.z);
    GL11.glTexCoord2f(1, 1);
    v = verts[2];
    GL11.glVertex3f(v.x, v.y, v.z);
    GL11.glTexCoord2f(1, 0);
    v = verts[3];
    GL11.glVertex3f(v.x, v.y, v.z);
    GL11.glEnd();
    GL11.glDepthMask(true);
}

From source file:src.graphics.space.Starfield.java

License:Open Source License

private void axisWithTransform(Mat3D transform, Texture tex, float radius) {
    final Vec3D tV = new Vec3D();
    tex.bindTex();/*  ww  w  .ja va2  s.  c o m*/

    GL11.glBegin(GL11.GL_QUADS);

    GL11.glNormal3f(0, 0, 0);

    transform.trans(tV.set(-1, -1, 0)).scale(1.1f * radius);
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(tV.x, tV.y, tV.z);

    transform.trans(tV.set(1, -1, 0)).scale(1.1f * radius);
    GL11.glTexCoord2f(1, 0);
    GL11.glVertex3f(tV.x, tV.y, tV.z);

    transform.trans(tV.set(1, 1, 0)).scale(1.1f * radius);
    GL11.glTexCoord2f(1, 1);
    GL11.glVertex3f(tV.x, tV.y, tV.z);

    transform.trans(tV.set(-1, 1, 0)).scale(1.1f * radius);
    GL11.glTexCoord2f(0, 1);
    GL11.glVertex3f(tV.x, tV.y, tV.z);

    GL11.glEnd();
}

From source file:src.graphics.widgets.UINode.java

License:Open Source License

/**  Utility methods for drawing/graphic display:
  *///  w  w  w  .j a v  a  2 s .c  om
final public static void drawQuad(float xmin, float ymin, float xmax, float ymax, float umin, float vmin,
        float umax, float vmax, float absDepth) {
    GL11.glTexCoord2f(umin, vmax);
    GL11.glVertex3f(xmin, ymin, absDepth);
    GL11.glTexCoord2f(umin, vmin);
    GL11.glVertex3f(xmin, ymax, absDepth);
    GL11.glTexCoord2f(umax, vmin);
    GL11.glVertex3f(xmax, ymax, absDepth);
    GL11.glTexCoord2f(umax, vmax);
    GL11.glVertex3f(xmax, ymin, absDepth);
}

From source file:taiga.gpvm.render.ColorEntityRenderer.java

License:Open Source License

@Override
public void render(Collection<Entity> ents, int pass, ReadableMatrix4 proj, ReadableMatrix4 modelview) {
    if (pass != HardcodedValues.OPAQUE_WORLD_LAYER)
        return;//w ww  .j  ava  2s  .c o  m

    ARBShaderObjects.glUseProgramObjectARB(0);
    GL11.glPointSize(size);

    FloatBuffer buffer = BufferUtils.createFloatBuffer(16);
    proj.store(buffer, false);
    buffer.flip();

    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadMatrix(buffer);

    buffer.rewind();
    modelview.store(buffer, false);
    buffer.flip();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadMatrix(buffer);

    GL11.glBegin(GL11.GL_POINTS);

    for (Entity ent : ents) {
        ReadableVector3f loc = ent.getBounds().getCenter();
        GL11.glVertex3f(loc.getX(), loc.getY(), loc.getZ());
        GL11.glColor3f(red, green, blue);
    }

    GL11.glEnd();
}

From source file:tectonicus.rasteriser.lwjgl.LwjglRasteriser.java

License:BSD License

public void vertex(final float x, final float y, final float z) {
    GL11.glVertex3f(x, y, z);
}

From source file:tectonicus.renderer.Frustum.java

License:BSD License

private void lineBetween(int start, int end) {
    GL11.glVertex3f(points[start].x, points[start].y, points[start].z);
    GL11.glVertex3f(points[end].x, points[end].y, points[end].z);
}

From source file:terminal.gld.TrueTypeFont.java

License:Open Source License

private void drawQuad(float drawX, float drawY, float drawX2, float drawY2, float srcX, float srcY, float srcX2,
        float srcY2) {
    float DrawWidth = drawX2 - drawX;
    float DrawHeight = drawY2 - drawY;
    float TextureSrcX = -.01f + srcX / textureWidth;
    float TextureSrcY = srcY / textureHeight;
    float SrcWidth = srcX2 - srcX;
    float SrcHeight = srcY2 - srcY;
    float RenderWidth = (SrcWidth / textureWidth);
    float RenderHeight = (SrcHeight / textureHeight);

    GL11.glTexCoord2f(TextureSrcX, TextureSrcY);
    GL11.glVertex3f(drawX, drawY, .1f);
    GL11.glTexCoord2f(TextureSrcX, TextureSrcY + RenderHeight);
    GL11.glVertex3f(drawX, drawY + DrawHeight, .1f);
    GL11.glTexCoord2f(TextureSrcX + RenderWidth, TextureSrcY + RenderHeight);
    GL11.glVertex3f(drawX + DrawWidth, drawY + DrawHeight, .1f);
    GL11.glTexCoord2f(TextureSrcX + RenderWidth, TextureSrcY);
    GL11.glVertex3f(drawX + DrawWidth, drawY, .1f);
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glVertex3f(float a, float b, float c) {
    GL11.glVertex3f(a, b, c);
}

From source file:tk.jacklin213.voxelgale.rendering.BasicRenderer.java

License:Apache License

private void renderCube() {
    // Cube GL11.glBegin(GL11.GL_QUADS);
    GL11.glBegin(GL11.GL_LINE_LOOP);/*www. j a v a2 s . co  m*/
    //Bellow code renders the quad
    //Render start
    GL11.glColor3f(1.0f, 1.0f, 0.0f);
    GL11.glVertex3f(1.0f, 1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, 1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, 1.0f, 1.0f);
    GL11.glVertex3f(1.0f, 1.0f, 1.0f);

    GL11.glColor3f(1.0f, 0.5f, 0.0f);
    GL11.glVertex3f(1.0f, -1.0f, 1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(1.0f, -1.0f, -1.0f);

    GL11.glColor3f(1.0f, 0.0f, 0.0f);
    GL11.glVertex3f(1.0f, 1.0f, 1.0f);
    GL11.glVertex3f(-1.0f, 1.0f, 1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
    GL11.glVertex3f(1.0f, -1.0f, 1.0f);

    GL11.glColor3f(1.0f, 1.0f, 0.0f);
    GL11.glVertex3f(1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, 1.0f, -1.0f);
    GL11.glVertex3f(1.0f, 1.0f, -1.0f);

    GL11.glColor3f(0.0f, 0.0f, 1.0f);
    GL11.glVertex3f(-1.0f, 1.0f, 1.0f);
    GL11.glVertex3f(-1.0f, 1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
    GL11.glVertex3f(-1.0f, -1.0f, 1.0f);

    GL11.glColor3f(1.0f, 0.0f, 1.0f);
    GL11.glVertex3f(1.0f, 1.0f, -1.0f);
    GL11.glVertex3f(1.0f, 1.0f, 1.0f);
    GL11.glVertex3f(1.0f, -1.0f, 1.0f);
    GL11.glVertex3f(1.0f, -1.0f, -1.0f);
    //Render end
    GL11.glEnd();
}