- synchronized(this) {
- for(Mesh.T t : mesh) t.glTriangle(gl, null);
- for(Mesh.Vertex v : mesh.vertices()) {
- Point p = v.getPoint();
- gl.glColor3f(1,1,1);
+ for(Mesh.T t : mesh) t.glTriangle(gl, null);
+ for(Mesh.Vertex v : mesh.vertices()) {
+ Point p = v.getPoint();
+ gl.glColor3f(1,1,1);
+ gl.glBegin(gl.GL_POINTS);
+ p.glVertex(gl);
+ gl.glEnd();
+ gl.glFlush();
+
+ Point projected = projection.times(p);
+ gl.glReadPixels((int)projected.x-1, (int)projected.y-1, 3, 3, gl.GL_RGB, gl.GL_UNSIGNED_BYTE, buf);
+
+ boolean vis = false;
+ for(int j=0; j<9*4; j++) vis |= buf.get(j)!=0;
+ v.visible = vis;
+ if (vis) {
+ gl.glColor3f(0,0,0);