- protected HashSet<Mesh.T> safeTriangles = new HashSet<Mesh.T>();
-
- private void draw(GL gl, boolean triangles, Iterable<Mesh.T> tris) { draw(gl, triangles, tris, Matrix.ONE); }
- private void draw(GL gl, boolean triangles, Iterable<Mesh.T> tris, Matrix m) {
- float red = 0.0f;
- float green = 0.0f;
- float blue = 0.0f;
- synchronized(safeTriangles) {
- for(Mesh.T t : tris) {
- if (red < 0.15) red = 1.0f;
- if (green < 0.15) green = 1.0f;
- if (blue < 0.15) blue = 1.0f;
- red -= .09f;
- green -= .12f;
- blue -= .15f;
-
- if (triangles) switch(t.color/*class*/) {
- case 0: gl.glColor4f((float)0.25, (float)0.25, (float)0.75, (float)0.3); break;
- case 1: gl.glColor4f((float)0.25, (float)0.75, (float)0.25, (float)0.3); break;
- case 2: gl.glColor4f((float)0.75, (float)0.25, (float)0.25, (float)0.3); break;
- case 3: gl.glColor4f((float)0.50, (float)0.50, (float)0.50, (float)0.3); break;
- case 4: gl.glColor4f((float)0.25, (float)0.75, (float)0.75, (float)0.3); break;
- case 5: gl.glColor4f((float)0.25, (float)0.75, (float)0.75, (float)0.3); break;
- case 6: gl.glColor4f((float)0.75, (float)0.25, (float)0.75, (float)0.3); break;
- }
-
- if (t.v1().visible && t.v2().visible && t.v3().visible) continue;
-
- /*
- if (t.e1().pair.t==null) gl.glColor4f((float)0.25, (float)0.25, (float)0.75, (float)0.3);
- else if (t.e2().pair.t==null) gl.glColor4f((float)0.25, (float)0.25, (float)0.75, (float)0.3);
- else if (t.e3().pair.t==null) gl.glColor4f((float)0.25, (float)0.25, (float)0.75, (float)0.3);
- else gl.glColor4f((float)0.75, (float)0.25, (float)0.25, (float)0.3);
- */
- //gl.glBegin(GL.GL_LINES);
-
- if (triangles) {
- t.glTriangle(gl, m);
- } else {
- gl.glDisable(GL.GL_LIGHTING);
- gl.glBegin(GL.GL_LINES);
- gl.glColor3f(1, 1, 1);
- m.times(t.e1().p1.goodp).glVertex(gl);
- m.times(t.e1().p2.goodp).glVertex(gl);
- m.times(t.e2().p1.goodp).glVertex(gl);
- m.times(t.e2().p2.goodp).glVertex(gl);
- m.times(t.e3().p1.goodp).glVertex(gl);
- m.times(t.e3().p2.goodp).glVertex(gl);
- gl.glEnd();
- gl.glEnable(GL.GL_LIGHTING);
- }