Example usage for org.lwjgl.opengl GL11 glPointSize

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

Introduction

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

Prototype

public static void glPointSize(@NativeType("GLfloat") float size) 

Source Link

Document

Controls the rasterization of points if no vertex, tessellation control, tessellation evaluation, or geometry shader is active.

Usage

From source file:illarion.graphics.lwjgl.DrawerLWJGL.java

License:Open Source License

/**
 * Draw a simple dot at a specified location on the screen.
 * //w  w  w  .  j  av a 2s  .  co  m
 * @param x x coordinate of the dot on the screen
 * @param y y coordinate of the dot on the screen
 * @param size size of the dot on the screen
 * @param color color of the dot on the screen
 */
@Override
public void drawDot(final int x, final int y, final float size, final SpriteColor color) {

    DriverSettingsLWJGL.getInstance().enableDrawDot();
    GL11.glPointSize(size / 2);

    color.setActiveColor();

    buffer.clear();
    buffer.put(x).put(y);
    buffer.flip();

    GL11.glVertexPointer(2, 0, buffer);
    GL11.glDrawArrays(GL11.GL_POINTS, 0, 1);
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static void glPointSize(float size) {
    GL11.glPointSize(size);
}

From source file:jake2.desktop.LWJGLAdapter.java

License:Open Source License

@Override
public void glPointSize(float value) {
    GL11.glPointSize(value);
}

From source file:kuake2.render.lwjgl.Main.java

License:Open Source License

/**
 * R_DrawParticles//from   ww  w  .  ja v a 2s  .  com
 */
void R_DrawParticles() {

    if (gl_ext_pointparameters.value != 0.0f && qglPointParameterfEXT) {

        //GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
        GL11.glVertexPointer(3, 0, particle_t.vertexArray);
        GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
        GL11.glColorPointer(4, true, 0, particle_t.getColorAsByteBuffer());

        GL11.glDepthMask(false);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glPointSize(gl_particle_size.value);

        GL11.glDrawArrays(GL11.GL_POINTS, 0, r_newrefdef.num_particles);

        GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
        //GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);

        GL11.glDisable(GL11.GL_BLEND);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_TEXTURE_2D);

    } else {
        GL_DrawParticles(r_newrefdef.num_particles);
    }
}

From source file:net.shadowmage.ancientwarfare.core.model.ModelPiece.java

License:Open Source License

public void renderForEditor(ModelPiece piece, Primitive prim, List<ModelPiece> highlightedPieces, float tw,
        float th) {
    GL11.glPushMatrix();//from ww w. j a va  2  s  .  co  m
    if (x != 0 || y != 0 || z != 0) {
        GL11.glTranslatef(x, y, z);
    }
    if (rx != 0) {
        GL11.glRotatef(rx, 1, 0, 0);
    }
    if (ry != 0) {
        GL11.glRotatef(ry, 0, 1, 0);
    }
    if (rz != 0) {
        GL11.glRotatef(rz, 0, 0, 1);
    }

    boolean selected = piece == this;
    boolean colored = selected || highlightedPieces.contains(this);
    if (selected) {
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_POINT_SMOOTH);
        GL11.glColor4f(1.0f, 0.f, 0.f, 1.f);
        GL11.glPointSize(5.f);
        GL11.glBegin(GL11.GL_POINTS);
        GL11.glVertex3f(0, 0, 0);
        GL11.glEnd();
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
    if (colored) {
        GL11.glColor4f(0.75f, 0.5f, 0.5f, 1.f);
    } else {
        GL11.glColor4f(1.f, 1.f, 1.f, 1.f);
    }
    for (Primitive primitive : this.primitives) {
        if (primitive == prim) {
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_TEXTURE_2D);
            GL11.glColor4f(1.0f, 0.f, 0.f, 1.f);
            GL11.glBegin(GL11.GL_POINTS);
            GL11.glVertex3f(prim.x, prim.y, prim.z);
            GL11.glEnd();
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glEnable(GL11.GL_TEXTURE_2D);
            GL11.glColor4f(1.0f, 0.5f, 0.5f, 1.f);
        } else if (colored) {
            GL11.glColor4f(0.75f, 0.5f, 0.5f, 1.f);
        } else {
            GL11.glColor4f(1.f, 1.f, 1.f, 1.f);
        }
        primitive.render(tw, th);
    }
    for (ModelPiece child : this.children) {
        child.renderForEditor(piece, prim, highlightedPieces, tw, th);
    }
    GL11.glPopMatrix();
}

From source file:OpenGLEngine.RenderGrid.java

public static void RenderGridProposedGhostAtoms(NICS_Grid GridToRender, Object GhastlyLock) {
    float X, Y, Z;
    synchronized (GhastlyLock) {
        // should only render a grid
        assert (GridToRender.GhostSetType() == 3);

        //faces points for a full cube: 1,2,3,4; 6,2,3,7; 5,6,7,8; 1,5,8,4; 1,2,6,5; 8,7,3,4; 
        // for only a z-plane: 8,7,3,4
        // for only a y plane: 1,5,8,4
        // for only an x-plane: 1,2,3,4 

        // render highlighted planes / cubes
        if (GridToRender.IsHighlighted()) {
            if (GridToRender.X_Plane) {
                // Render Highlight of Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();/*from  www.ja  va2 s  . com*/

                // render outline
                GL11.glLineWidth(RenderSettings.OutlineLineWidth);

                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

                //ArrayList<Vector3f[]> QuadPoints   
            } else if (GridToRender.Y_Plane) {
                // Render Highlight of Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline
                GL11.glLineWidth(RenderSettings.OutlineLineWidth);

                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else if (GridToRender.Z_Plane) {
                // Render Highlight of Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline
                GL11.glLineWidth(RenderSettings.OutlineLineWidth);

                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else {
                // Render Highlight of Bounding Box
                //faces points for a full cube: 1,2,3,4; 6,2,3,7; 5,6,7,8; 1,5,8,4; 1,2,6,5; 8,7,3,4; 

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[1].x, GridToRender.CubeSelectedPoints[1].y,
                        GridToRender.CubeSelectedPoints[1].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[2].x, GridToRender.CubeSelectedPoints[2].y,
                        GridToRender.CubeSelectedPoints[2].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[3].x, GridToRender.CubeSelectedPoints[3].y,
                        GridToRender.CubeSelectedPoints[3].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[4].x, GridToRender.CubeSelectedPoints[4].y,
                        GridToRender.CubeSelectedPoints[4].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[6].x, GridToRender.CubeSelectedPoints[6].y,
                        GridToRender.CubeSelectedPoints[6].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[2].x, GridToRender.CubeSelectedPoints[2].y,
                        GridToRender.CubeSelectedPoints[2].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[3].x, GridToRender.CubeSelectedPoints[3].y,
                        GridToRender.CubeSelectedPoints[3].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[7].x, GridToRender.CubeSelectedPoints[7].y,
                        GridToRender.CubeSelectedPoints[7].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[5].x, GridToRender.CubeSelectedPoints[5].y,
                        GridToRender.CubeSelectedPoints[5].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[6].x, GridToRender.CubeSelectedPoints[6].y,
                        GridToRender.CubeSelectedPoints[6].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[7].x, GridToRender.CubeSelectedPoints[7].y,
                        GridToRender.CubeSelectedPoints[7].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[8].x, GridToRender.CubeSelectedPoints[8].y,
                        GridToRender.CubeSelectedPoints[8].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[1].x, GridToRender.CubeSelectedPoints[1].y,
                        GridToRender.CubeSelectedPoints[1].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[5].x, GridToRender.CubeSelectedPoints[5].y,
                        GridToRender.CubeSelectedPoints[5].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[8].x, GridToRender.CubeSelectedPoints[8].y,
                        GridToRender.CubeSelectedPoints[8].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[4].x, GridToRender.CubeSelectedPoints[4].y,
                        GridToRender.CubeSelectedPoints[4].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[1].x, GridToRender.CubeSelectedPoints[1].y,
                        GridToRender.CubeSelectedPoints[1].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[2].x, GridToRender.CubeSelectedPoints[2].y,
                        GridToRender.CubeSelectedPoints[2].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[6].x, GridToRender.CubeSelectedPoints[6].y,
                        GridToRender.CubeSelectedPoints[6].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[5].x, GridToRender.CubeSelectedPoints[5].y,
                        GridToRender.CubeSelectedPoints[5].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[8].x, GridToRender.CubeSelectedPoints[8].y,
                        GridToRender.CubeSelectedPoints[8].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[7].x, GridToRender.CubeSelectedPoints[7].y,
                        GridToRender.CubeSelectedPoints[7].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[3].x, GridToRender.CubeSelectedPoints[3].y,
                        GridToRender.CubeSelectedPoints[3].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[4].x, GridToRender.CubeSelectedPoints[4].y,
                        GridToRender.CubeSelectedPoints[4].z);
                GL11.glEnd();

                // render the internal cube as well                                                  

                GL11.glColor4f(RenderSettings.GridCubeProposedColor.x, RenderSettings.GridCubeProposedColor.y,
                        RenderSettings.GridCubeProposedColor.z, RenderSettings.GridCubeProposedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);

                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);

                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);

                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);

                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);

                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline of the cube
                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);

                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            }
            // render 'non-highlighted' planes/cubes 
        } else {
            if (GridToRender.X_Plane) {
                // Render Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeProposedColor.x, RenderSettings.GridCubeProposedColor.y,
                        RenderSettings.GridCubeProposedColor.z, RenderSettings.GridCubeProposedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineProposedColor.x,
                        RenderSettings.GridOutlineProposedColor.y, RenderSettings.GridOutlineProposedColor.z,
                        RenderSettings.GridOutlineProposedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else if (GridToRender.Y_Plane) {
                // Render Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeProposedColor.x, RenderSettings.GridCubeProposedColor.y,
                        RenderSettings.GridCubeProposedColor.z, RenderSettings.GridCubeProposedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineProposedColor.x,
                        RenderSettings.GridOutlineProposedColor.y, RenderSettings.GridOutlineProposedColor.z,
                        RenderSettings.GridOutlineProposedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else if (GridToRender.Z_Plane) {
                // Render Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeProposedColor.x, RenderSettings.GridCubeProposedColor.y,
                        RenderSettings.GridCubeProposedColor.z, RenderSettings.GridCubeProposedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineProposedColor.x,
                        RenderSettings.GridOutlineProposedColor.y, RenderSettings.GridOutlineProposedColor.z,
                        RenderSettings.GridOutlineProposedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else {
                // Render Bounding Box 
                //faces points for a full cube: 1,2,3,4; 6,2,3,7; 5,6,7,8; 1,5,8,4; 1,2,6,5; 8,7,3,4; 

                GL11.glColor4f(RenderSettings.GridCubeProposedColor.x, RenderSettings.GridCubeProposedColor.y,
                        RenderSettings.GridCubeProposedColor.z, RenderSettings.GridCubeProposedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);

                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);

                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);

                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);

                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);

                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline of the cube

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineProposedColor.x,
                        RenderSettings.GridOutlineProposedColor.y, RenderSettings.GridOutlineProposedColor.z,
                        RenderSettings.GridOutlineProposedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render the grid points
                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointProposedColor.x,
                            RenderSettings.GridSurfacePointProposedColor.y,
                            RenderSettings.GridSurfacePointProposedColor.z,
                            RenderSettings.GridOutlineProposedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            }

        }

    }

}

From source file:OpenGLEngine.RenderGrid.java

public static void RenderGridGhostAtoms(NICS_Grid GridToRender, Object GhastlyLock) {
    float X, Y, Z;
    synchronized (GhastlyLock) {
        // should only render a grid
        assert (GridToRender.GhostSetType() == 3);

        //faces points for a full cube: 1,2,3,4; 6,2,3,7; 5,6,7,8; 1,5,8,4; 1,2,6,5; 8,7,3,4; 
        // for only a z-plane: 8,7,3,4
        // for only a y plane: 1,5,8,4
        // for only an x-plane: 1,2,3,4 

        // render highlighted planes / cubes
        if (GridToRender.IsHighlighted()) {
            if (GridToRender.X_Plane) {
                // Render Highlight of Bounding plane               

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();//from   www  .  j a v  a2  s.c om

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                // render grid points

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else if (GridToRender.Y_Plane) {
                // Render Highlight of Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else if (GridToRender.Z_Plane) {
                // Render Highlight of Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glEnd();

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else {
                // Render Highlight of Bounding Box
                //faces points for a full cube: 1,2,3,4; 6,2,3,7; 5,6,7,8; 1,5,8,4; 1,2,6,5; 8,7,3,4; 

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[1].x, GridToRender.CubeSelectedPoints[1].y,
                        GridToRender.CubeSelectedPoints[1].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[2].x, GridToRender.CubeSelectedPoints[2].y,
                        GridToRender.CubeSelectedPoints[2].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[3].x, GridToRender.CubeSelectedPoints[3].y,
                        GridToRender.CubeSelectedPoints[3].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[4].x, GridToRender.CubeSelectedPoints[4].y,
                        GridToRender.CubeSelectedPoints[4].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[6].x, GridToRender.CubeSelectedPoints[6].y,
                        GridToRender.CubeSelectedPoints[6].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[2].x, GridToRender.CubeSelectedPoints[2].y,
                        GridToRender.CubeSelectedPoints[2].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[3].x, GridToRender.CubeSelectedPoints[3].y,
                        GridToRender.CubeSelectedPoints[3].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[7].x, GridToRender.CubeSelectedPoints[7].y,
                        GridToRender.CubeSelectedPoints[7].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[5].x, GridToRender.CubeSelectedPoints[5].y,
                        GridToRender.CubeSelectedPoints[5].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[6].x, GridToRender.CubeSelectedPoints[6].y,
                        GridToRender.CubeSelectedPoints[6].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[7].x, GridToRender.CubeSelectedPoints[7].y,
                        GridToRender.CubeSelectedPoints[7].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[8].x, GridToRender.CubeSelectedPoints[8].y,
                        GridToRender.CubeSelectedPoints[8].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[1].x, GridToRender.CubeSelectedPoints[1].y,
                        GridToRender.CubeSelectedPoints[1].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[5].x, GridToRender.CubeSelectedPoints[5].y,
                        GridToRender.CubeSelectedPoints[5].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[8].x, GridToRender.CubeSelectedPoints[8].y,
                        GridToRender.CubeSelectedPoints[8].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[4].x, GridToRender.CubeSelectedPoints[4].y,
                        GridToRender.CubeSelectedPoints[4].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[1].x, GridToRender.CubeSelectedPoints[1].y,
                        GridToRender.CubeSelectedPoints[1].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[2].x, GridToRender.CubeSelectedPoints[2].y,
                        GridToRender.CubeSelectedPoints[2].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[6].x, GridToRender.CubeSelectedPoints[6].y,
                        GridToRender.CubeSelectedPoints[6].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[5].x, GridToRender.CubeSelectedPoints[5].y,
                        GridToRender.CubeSelectedPoints[5].z);

                GL11.glVertex3f(GridToRender.CubeSelectedPoints[8].x, GridToRender.CubeSelectedPoints[8].y,
                        GridToRender.CubeSelectedPoints[8].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[7].x, GridToRender.CubeSelectedPoints[7].y,
                        GridToRender.CubeSelectedPoints[7].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[3].x, GridToRender.CubeSelectedPoints[3].y,
                        GridToRender.CubeSelectedPoints[3].z);
                GL11.glVertex3f(GridToRender.CubeSelectedPoints[4].x, GridToRender.CubeSelectedPoints[4].y,
                        GridToRender.CubeSelectedPoints[4].z);
                GL11.glEnd();

                // render the internal cube as well                

                GL11.glColor4f(RenderSettings.GridCubeSelectedColor.x, RenderSettings.GridCubeSelectedColor.y,
                        RenderSettings.GridCubeSelectedColor.z, RenderSettings.GridCubeSelectedColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glColor4f(RenderSettings.GridCubeColor.x, RenderSettings.GridCubeColor.y,
                        RenderSettings.GridCubeColor.z, RenderSettings.GridCubeColor.w);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);

                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);

                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);

                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);

                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);

                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);

                GL11.glEnd();

                // render outline of the cube

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineSelectedColor.x,
                        RenderSettings.GridOutlineSelectedColor.y, RenderSettings.GridOutlineSelectedColor.z,
                        RenderSettings.GridOutlineSelectedColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);

                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);

                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);

                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);

                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);

                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointSelectedColor.x,
                            RenderSettings.GridSurfacePointSelectedColor.y,
                            RenderSettings.GridSurfacePointSelectedColor.z,
                            RenderSettings.GridOutlineSelectedColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            }
            // render 'non-highlighted' planes/cubes 
        } else {
            if (GridToRender.X_Plane) {
                // Render Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeColor.x, RenderSettings.GridCubeColor.y,
                        RenderSettings.GridCubeColor.z, RenderSettings.GridCubeColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineColor.x, RenderSettings.GridOutlineColor.y,
                        RenderSettings.GridOutlineColor.z, RenderSettings.GridOutlineColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else if (GridToRender.Y_Plane) {
                // Render Bounding plane

                GL11.glColor4f(RenderSettings.GridCubeColor.x, RenderSettings.GridCubeColor.y,
                        RenderSettings.GridCubeColor.z, RenderSettings.GridCubeColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineColor.x, RenderSettings.GridOutlineColor.y,
                        RenderSettings.GridOutlineColor.z, RenderSettings.GridOutlineColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glEnd();

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else if (GridToRender.Z_Plane) {
                // Render Bounding plane                

                GL11.glColor4f(RenderSettings.GridCubeColor.x, RenderSettings.GridCubeColor.y,
                        RenderSettings.GridCubeColor.z, RenderSettings.GridCubeColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineColor.x, RenderSettings.GridOutlineColor.y,
                        RenderSettings.GridOutlineColor.z, RenderSettings.GridOutlineColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glEnd();

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            } else {
                // Render Bounding Box 
                //faces points for a full cube: 1,2,3,4; 6,2,3,7; 5,6,7,8; 1,5,8,4; 1,2,6,5; 8,7,3,4; 

                GL11.glColor4f(RenderSettings.GridCubeColor.x, RenderSettings.GridCubeColor.y,
                        RenderSettings.GridCubeColor.z, RenderSettings.GridCubeColor.w);
                GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                // render outline of the cube

                GL11.glLineWidth(RenderSettings.OutlineLineWidth);
                GL11.glColor4f(RenderSettings.GridOutlineColor.x, RenderSettings.GridOutlineColor.y,
                        RenderSettings.GridOutlineColor.z, RenderSettings.GridOutlineColor.w);
                GL11.glBegin(GL11.GL_LINES);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[2].x, GridToRender.CubePoints[2].y,
                        GridToRender.CubePoints[2].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[3].x, GridToRender.CubePoints[3].y,
                        GridToRender.CubePoints[3].z);
                GL11.glVertex3f(GridToRender.CubePoints[6].x, GridToRender.CubePoints[6].y,
                        GridToRender.CubePoints[6].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[7].x, GridToRender.CubePoints[7].y,
                        GridToRender.CubePoints[7].z);
                GL11.glVertex3f(GridToRender.CubePoints[5].x, GridToRender.CubePoints[5].y,
                        GridToRender.CubePoints[5].z);
                GL11.glVertex3f(GridToRender.CubePoints[1].x, GridToRender.CubePoints[1].y,
                        GridToRender.CubePoints[1].z);
                GL11.glVertex3f(GridToRender.CubePoints[8].x, GridToRender.CubePoints[8].y,
                        GridToRender.CubePoints[8].z);
                GL11.glVertex3f(GridToRender.CubePoints[4].x, GridToRender.CubePoints[4].y,
                        GridToRender.CubePoints[4].z);
                GL11.glEnd();

                if (!RenderSettings.RenderPointsAsQuad) {
                    GL11.glPointSize(RenderSettings.GridPointSize);
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_POINTS);
                    for (int itor = 0; itor < GridToRender.SurfaceAtomCoordinates.size(); itor++) {

                        GL11.glVertex3f(GridToRender.SurfaceAtomCoordinates.get(itor).x,
                                GridToRender.SurfaceAtomCoordinates.get(itor).y,
                                GridToRender.SurfaceAtomCoordinates.get(itor).z);
                    }
                    GL11.glEnd();
                    // render the points as a quad
                } else if (GridToRender.QuadPoints.size() < RenderSettings.NO_DISPLAY) {
                    GL11.glColor4f(RenderSettings.GridSurfacePointColor.x,
                            RenderSettings.GridSurfacePointColor.y, RenderSettings.GridSurfacePointColor.z,
                            RenderSettings.GridOutlineColor.w);
                    GL11.glBegin(GL11.GL_TRIANGLES);
                    for (int itor = 0; itor < GridToRender.QuadPoints.size(); itor++) {
                        // rendered as a triangle instead
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[1].x;
                        Y = GridToRender.QuadPoints.get(itor)[1].y;
                        Z = GridToRender.QuadPoints.get(itor)[1].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[0].x;
                        Y = GridToRender.QuadPoints.get(itor)[0].y;
                        Z = GridToRender.QuadPoints.get(itor)[0].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[2].x;
                        Y = GridToRender.QuadPoints.get(itor)[2].y;
                        Z = GridToRender.QuadPoints.get(itor)[2].z;
                        GL11.glVertex3f(X, Y, Z);
                        X = GridToRender.QuadPoints.get(itor)[3].x;
                        Y = GridToRender.QuadPoints.get(itor)[3].y;
                        Z = GridToRender.QuadPoints.get(itor)[3].z;
                        GL11.glVertex3f(X, Y, Z);
                    }
                    GL11.glEnd();

                }

            }

        }

    }

}

From source file:org.fenggui.binding.render.lwjgl.LWJGLOpenGL.java

License:Open Source License

public void pointSize(float size) {
    GL11.glPointSize(size);
}

From source file:org.jogamp.glg2d.impl.gl2.FastLineVisitor.java

License:Apache License

@Override
public void setStroke(BasicStroke stroke) {
    GL11.glLineWidth(glLineWidth);/*from  www .j av a 2  s .co  m*/
    GL11.glPointSize(glLineWidth);

    /*
     * Not perfect copy of the BasicStroke implementation, but it does get
     * decently close. The pattern is pretty much the same. I think it's pretty
     * much impossible to do with out a fragment shader and only the fixed
     * function pipeline.
     */
    float[] dash = stroke.getDashArray();
    if (dash != null) {
        float totalLength = 0;
        for (float f : dash) {
            totalLength += f;
        }

        float lengthSoFar = 0;
        int prevIndex = 0;
        int mask = 0;
        for (int i = 0; i < dash.length; i++) {
            lengthSoFar += dash[i];

            int nextIndex = (int) (lengthSoFar / totalLength * 16);
            for (int j = prevIndex; j < nextIndex; j++) {
                mask |= (~i & 1) << j;
            }

            prevIndex = nextIndex;
        }

        /*
         * XXX Should actually use the stroke phase, but not sure how yet.
         */

        GL11.glEnable(GL11.GL_LINE_STIPPLE);
        int factor = (int) totalLength;
        GL11.glLineStipple(factor >> 4, (short) mask);
    } else {
        GL11.glDisable(GL11.GL_LINE_STIPPLE);
    }

    this.stroke = stroke;
}

From source file:shadowmage.ancient_framework.client.model.ModelPiece.java

License:Open Source License

public void renderForEditor(ModelPiece piece, Primitive prim) {
    GL11.glPushMatrix();//from www .j a v  a 2 s.co m
    if (x != 0 || y != 0 || z != 0) {
        GL11.glTranslatef(x, y, z);
    }
    if (rx != 0) {
        GL11.glRotatef(rx, 1, 0, 0);
    }
    if (ry != 0) {
        GL11.glRotatef(ry, 0, 1, 0);
    }
    if (rz != 0) {
        GL11.glRotatef(rz, 0, 0, 1);
    }
    if (piece == this) {
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_POINT_SMOOTH);
        GL11.glColor4f(1.0f, 0.f, 0.f, 1.f);
        GL11.glPointSize(5.f);
        GL11.glBegin(GL11.GL_POINTS);
        GL11.glVertex3f(0, 0, 0);
        GL11.glEnd();
        GL11.glColor4f(0.75f, 0.5f, 0.5f, 1.f);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
    for (Primitive primitive : this.primitives) {
        if (primitive == prim) {
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_TEXTURE_2D);

            GL11.glColor4f(1.0f, 0.f, 0.f, 1.f);

            GL11.glBegin(GL11.GL_POINTS);
            GL11.glVertex3f(prim.x, prim.y, prim.z);
            GL11.glEnd();

            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glEnable(GL11.GL_TEXTURE_2D);

            GL11.glColor4f(1.0f, 0.5f, 0.5f, 1.f);
        }
        primitive.render();
        if (primitive == prim) {
            GL11.glColor4f(0.75f, 0.5f, 0.5f, 1.f);
        }
    }
    for (ModelPiece child : this.children) {
        child.renderForEditor(piece, prim);
    }
    GL11.glColor4f(1.f, 1.f, 1.f, 1.f);
    GL11.glPopMatrix();
}