List of usage examples for org.lwjgl.opengl GL11 GL_POINTS
int GL_POINTS
To view the source code for org.lwjgl.opengl GL11 GL_POINTS.
Click Source Link
From source file:illarion.graphics.lwjgl.DrawerLWJGL.java
License:Open Source License
/** * Draw a simple dot at a specified location on the screen. * /*from w ww.j av a2s. c om*/ * @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.github.minecraftgui.controllers.Render.java
License:Open Source License
public void drawOval(int x, int y, int width, int height, Color color) { if (color.getAlpha() != 0) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND);// w ww.j a va2 s . c o m GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f((color.getRed() / 255.0f), (color.getGreen() / 255.0f), (color.getBlue() / 255.0f), (color.getAlpha() / 255.0f)); GL11.glBegin(GL11.GL_POINTS); { for (double angle = 0; angle <= 90; angle += .5) { double xLoc = x + width * Math.cos(angle * (Math.PI / 180)); double yLoc = y + height * Math.sin(angle * (Math.PI / 180)); double distanceY = yLoc - y; double distanceX = xLoc - x; GL11.glVertex2d(xLoc - distanceX * 2, yLoc - (distanceY) * 2); GL11.glVertex2d(xLoc - distanceX * 2, yLoc - (distanceY) * 2 + distanceY * 2); GL11.glVertex2d(xLoc + 1, yLoc - (distanceY) * 2 + distanceY * 2); GL11.glVertex2d(xLoc + 1, yLoc - (distanceY) * 2); } } GL11.glEnd(); GL11.glEnable(GL11.GL_TEXTURE_2D); } }
From source file:ivorius.ivtoolkit.models.loaders.G3DModelLoader.java
License:Apache License
private static int parseGLDrawMode(String type) { switch (type) { case "TRIANGLES": return GL11.GL_TRIANGLES; case "LINES": return GL11.GL_LINES; case "POINTS": return GL11.GL_POINTS; case "TRIANGLE_STRIP": return GL11.GL_TRIANGLE_STRIP; case "LINE_STRIP": return GL11.GL_LINE_STRIP; default:/*from w w w. j a v a 2 s.c o m*/ throw new RuntimeException("Unknown primitive type '" + type + "', should be one of triangle, trianglestrip, line, linestrip, lineloop or point"); } }
From source file:kuake2.render.lwjgl.Main.java
License:Open Source License
/** * R_DrawParticles/*from w ww . j a va 2 s . c om*/ */ 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();// w w w . 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); } 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 w ww.j av a2s .c o m*/ // 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();/*w ww . j av a 2s . c o m*/ // 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.cogaen.lwjgl.scene.PointVisual.java
License:Open Source License
@Override public void render() { getColor().apply(); GL11.glBegin(GL11.GL_POINTS); GL11.glVertex2f(0f, 0f); GL11.glEnd(); }
From source file:org.fenggui.binding.render.lwjgl.LWJGLOpenGL.java
License:Open Source License
public void startPoints() { GL11.glBegin(GL11.GL_POINTS); }
From source file:org.jogamp.glg2d.impl.gl2.FastLineVisitor.java
License:Apache License
protected void drawLine(boolean close) { FloatBuffer buf = buffer.getBuffer(); int p = buf.position(); buffer.drawBuffer(close ? GL11.GL_LINE_LOOP : GL11.GL_LINE_STRIP); /*// ww w . j a v a 2s . c om * We'll ignore butt endcaps, but we'll pretend like we're drawing round, * bevel or miter corners as well as round or square corners by just putting * a point there. Since our line should be very thin, pixel-wise, it * shouldn't be noticeable. */ if (stroke.getDashArray() == null) { buf.position(p); buffer.drawBuffer(GL11.GL_POINTS); } }