List of usage examples for org.lwjgl.opengl GL11 glEnd
public static native void glEnd();
From source file:fr.def.iss.vd2.lib_v3d.camera.V3DSimple2DCamera.java
License:Open Source License
private void displayTarget() { GL11.glColor4f(1.0f, 0.5f, 0.5f, 0.8f); GL11.glLineWidth(1.2f);/* w ww. ja v a 2s . c om*/ GL11.glBegin(GL11.GL_LINES); { GL11.glColor4f(1.0f, 0.0f, 0.0f, 0.8f); GL11.glVertex3d(-1, 0, 0); GL11.glVertex3d(1, 0, 0); GL11.glVertex3d(0.9, 0.1, 0); GL11.glVertex3d(1, 0, 0); GL11.glVertex3d(0.9, -0.1, 0); GL11.glVertex3d(1, 0, 0); //y GL11.glColor4f(0.0f, 1.0f, 0.0f, 0.8f); GL11.glVertex3d(0, -1, 0); GL11.glVertex3d(0, 1, 0); GL11.glVertex3d(0.1, 0.9, 0); GL11.glVertex3d(0, 1, 0); GL11.glVertex3d(-0.1, 0.9, 0); GL11.glVertex3d(0, 1, 0); //z GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.8f); GL11.glVertex3d(0, 0, -1); GL11.glVertex3d(0, 0, 1); GL11.glVertex3d(0.1, 0, 0.9); GL11.glVertex3d(0, 0, 1); GL11.glVertex3d(-0.1, 0, 0.9); GL11.glVertex3d(0, 0, 1); } GL11.glEnd(); GL11.glPointSize(1.2f); GL11.glBegin(GL11.GL_POINTS); { GL11.glVertex3d(position.x, position.y, 0); } GL11.glEnd(); }
From source file:fr.def.iss.vd2.lib_v3d.camera.V3DSimple3DCamera.java
License:Open Source License
private void displayTarget() { GL11.glColor4f(1.0f, 0.5f, 0.5f, 0.8f); GL11.glLineWidth(1.2f);/* w w w .j a v a2s. c o m*/ GL11.glBegin(GL11.GL_LINES); { GL11.glColor4f(1.0f, 0.0f, 0.0f, 0.8f); GL11.glVertex3d(-1, 0, 0); GL11.glVertex3d(1, 0, 0); GL11.glVertex3d(0.9, 0.1, 0); GL11.glVertex3d(1, 0, 0); GL11.glVertex3d(0.9, -0.1, 0); GL11.glVertex3d(1, 0, 0); //y GL11.glColor4f(0.0f, 1.0f, 0.0f, 0.8f); GL11.glVertex3d(0, -1, 0); GL11.glVertex3d(0, 1, 0); GL11.glVertex3d(0.1, 0.9, 0); GL11.glVertex3d(0, 1, 0); GL11.glVertex3d(-0.1, 0.9, 0); GL11.glVertex3d(0, 1, 0); //z GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.8f); GL11.glVertex3d(0, 0, -1); GL11.glVertex3d(0, 0, 1); GL11.glVertex3d(0.1, 0, 0.9); GL11.glVertex3d(0, 0, 1); GL11.glVertex3d(-0.1, 0, 0.9); GL11.glVertex3d(0, 0, 1); } GL11.glEnd(); GL11.glPointSize(1.2f); GL11.glBegin(GL11.GL_POINTS); { GL11.glVertex3d(position.x, position.y, position.z); } GL11.glEnd(); }
From source file:fr.def.iss.vd2.lib_v3d.element.basemap.PolyBasemap.java
License:Open Source License
private void draw() { vertices.clear();/*from www . j av a 2 s . c o m*/ stripVertexCount.clear(); float dx = -(minX / 2 + maxX / 2) * innerScale; float dy = -(minY / 2 + maxY / 2) * innerScale; GL11.glPushMatrix(); GL11.glTranslatef(dx, dy, 0); GL11.glScalef(innerScale, innerScale, innerScale); while (stripVertexCount.hasRemaining()) { int lineLenght = stripVertexCount.get(); GL11.glBegin(GL11.GL_LINE_STRIP); // Draw line for (int j = 0; j < lineLenght; j++) { if (vertices.remaining() >= 2) { float x = vertices.get(); float y = vertices.get(); GL11.glVertex3f(x, y, 0.0f); } else { // we should log the problem, but this method is called too // often (each time GL redraws). We don't want to flood the // logs, so we just ignore the problem silently. The // correctness of the data should be done at load time. } } GL11.glEnd(); } GL11.glPopMatrix(); }
From source file:fr.def.iss.vd2.lib_v3d.element.V3DBoundingBox.java
License:Open Source License
public void display() { if (showCenter) { GL11.glColor4f(centerColor.r, centerColor.g, centerColor.b, centerColor.a); GL11.glPointSize(4.0f);//from w w w . j a v a2 s . c om GL11.glBegin(GL11.GL_POINTS); GL11.glVertex3d(center.x, center.y, center.z); GL11.glEnd(); } if (flat || size.z == 0) { displayFlat(); } else { displayThick(); } }
From source file:fr.def.iss.vd2.lib_v3d.element.V3DBoundingBox.java
License:Open Source License
public void displayFlatLines() { float x0 = position.x - size.x / 2; float y0 = position.y - size.y / 2; float x1 = position.x + size.x / 2; float y1 = position.y + size.y / 2; GL11.glColor4f(lineColor.r, lineColor.g, lineColor.b, lineColor.a); GL11.glLineWidth(2.0f);//from w w w. j a v a2 s .c om GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3d(x0, y1, 0); GL11.glVertex3d(x0, y0, 0); GL11.glVertex3d(x1, y0, 0); GL11.glVertex3d(x1, y1, 0); GL11.glEnd(); }
From source file:fr.def.iss.vd2.lib_v3d.element.V3DBoundingBox.java
License:Open Source License
public void displayFlatFaces() { float x0 = position.x - size.x / 2; float y0 = position.y - size.y / 2; float x1 = position.x + size.x / 2; float y1 = position.y + size.y / 2; GL11.glColor4f(faceColor.r, faceColor.g, faceColor.b, faceColor.a); GL11.glBegin(GL11.GL_QUADS);/*from w w w.ja v a2 s . c o m*/ GL11.glVertex3d(x0, y1, 0); GL11.glVertex3d(x0, y0, 0); GL11.glVertex3d(x1, y0, 0); GL11.glVertex3d(x1, y1, 0); GL11.glEnd(); }
From source file:fr.def.iss.vd2.lib_v3d.element.V3DBoundingBox.java
License:Open Source License
public void displayThickLines() { float x0 = position.x - size.x / 2; float x1 = position.x + size.x / 2; float y0 = position.y - size.y / 2; float y1 = position.y + size.y / 2; float z0 = position.z - size.z / 2; float z1 = position.z + size.z / 2; GL11.glColor4f(lineColor.r, lineColor.g, lineColor.b, lineColor.a); GL11.glLineWidth(2.0f);//from ww w. j a va 2s . c o m GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x1, y1, z1); GL11.glVertex3d(x1, y0, z1); GL11.glEnd(); GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y1, z0); GL11.glEnd(); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x1, y0, z1); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y1, z1); GL11.glVertex3d(x1, y1, z0); GL11.glEnd(); }
From source file:fr.def.iss.vd2.lib_v3d.element.V3DBoundingBox.java
License:Open Source License
public void displayThickFaces() { float x0 = position.x - size.x / 2; float x1 = position.x + size.x / 2; float y0 = position.y - size.y / 2; float y1 = position.y + size.y / 2; float z0 = position.z - size.z / 2; float z1 = position.z + size.z / 2; GL11.glColor4f(faceColor.r, faceColor.g, faceColor.b, faceColor.a); GL11.glBegin(GL11.GL_QUADS);/*from w w w . j a va2 s.co m*/ GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y0, z1); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x1, y1, z1); GL11.glVertex3d(x1, y1, z0); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x1, y0, z1); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y1, z0); GL11.glVertex3d(x1, y1, z1); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x1, y1, z0); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x1, y0, z1); GL11.glVertex3d(x1, y1, z1); GL11.glEnd(); }
From source file:fr.def.iss.vd2.lib_v3d.element.V3DBox.java
License:Open Source License
@Override protected void doDisplay(I3dCamera camera) { float x0 = -size.x / 2; float x1 = size.x / 2; float y0 = -size.y / 2; float y1 = size.y / 2; float z0 = -size.z / 2; float z1 = size.z / 2; if (renderMode == RenderMode.PLAIN) { //GL11.glEnable(GL11.GL_LIGHTING); GL11.glBegin(GL11.GL_QUADS);//w ww . j av a2 s . co m GL11.glNormal3f(0, 1, 0); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y0, z1); GL11.glNormal3f(1, 0, 0); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x0, y0, z1); GL11.glNormal3f(0, -1, 0); GL11.glVertex3d(x1, y1, z1); GL11.glVertex3d(x1, y1, z0); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y1, z1); GL11.glNormal3f(-1, 0, 0); GL11.glVertex3d(x1, y0, z1); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y1, z0); GL11.glVertex3d(x1, y1, z1); GL11.glNormal3f(0, 0, 1); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x1, y1, z0); GL11.glVertex3d(x1, y0, z0); GL11.glNormal3f(0, 0, -1); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x1, y0, z1); GL11.glVertex3d(x1, y1, z1); GL11.glEnd(); GL11.glDisable(GL11.GL_LIGHTING); } if (renderMode == RenderMode.SOLID) { GL11.glLineWidth(thickness); GL11.glEnable(GL11.GL_LINE_STIPPLE); GL11.glLineStipple(stippleFactor, stipplePattern); GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x1, y1, z1); GL11.glVertex3d(x1, y0, z1); GL11.glEnd(); GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y1, z0); GL11.glEnd(); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(x0, y1, z1); GL11.glVertex3d(x0, y1, z0); GL11.glVertex3d(x0, y0, z1); GL11.glVertex3d(x0, y0, z0); GL11.glVertex3d(x1, y0, z1); GL11.glVertex3d(x1, y0, z0); GL11.glVertex3d(x1, y1, z1); GL11.glVertex3d(x1, y1, z0); GL11.glEnd(); GL11.glDisable(GL11.GL_LINE_STIPPLE); } }
From source file:fr.def.iss.vd2.lib_v3d.element.V3DCircle.java
License:Open Source License
private void drawCircle() { GL11.glBegin(GL11.GL_TRIANGLE_FAN);/* w w w. ja va 2 s. c o m*/ if (customColor) { GL11.glPushAttrib(GL11.GL_CURRENT_BIT); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor3f(innerColor.r, innerColor.g, innerColor.b); } GL11.glVertex3f(0.0f, 0.0f, 0.0f); // center float step = 2f * (float) Math.PI / (float) quality; if (customColor) { GL11.glColor4f(outerColor.r, outerColor.g, outerColor.b, outerColor.a); } for (int i = 0; i <= quality; i++) { GL11.glVertex3f((float) (radius * Math.cos(step * i)), (float) (radius * Math.sin(step * i)), 0f); } if (customColor) { GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glPopAttrib(); } GL11.glEnd(); }