+
+ public boolean option_wireframe = false;
+ public boolean option_errorNormals = false;
+
+ public void render(GL gl, Matrix m) {
+ if (option_wireframe) {
+ gl.glDisable(GL.GL_LIGHTING);
+ gl.glBegin(GL.GL_LINES);
+ gl.glColor3f(1, 1, 1);
+ for (T t : this) {
+ 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);
+ return;
+ }
+ for(T t : this) {
+ gl.glColor4f((float)(0.25+(0.05*t.color)),
+ (float)(0.25+(0.05*t.color)),
+ (float)(0.75+(0.05*t.color)),
+ (float)0.3);
+ t.glTriangle(gl, m);
+ }
+ if (option_errorNormals)
+ for(T t : this)
+ for(Mesh.Vertex p : new Mesh.Vertex[] { t.v1(), t.v2(), t.v3() }) {
+ if (p.ok) {
+ gl.glBegin(GL.GL_LINES);
+ gl.glColor3f(1, 1, 1);
+ p.p.glVertex(gl);
+ p.p.plus(p.norm().times((float)p.error()*10)).glVertex(gl);
+ gl.glEnd();
+ }
+ }
+ }
+