+
+ if (drawEdge) {
+ for(Mesh.E e : (Iterable<Mesh.E>)closestEdge.getBoundPeers()) {
+ gl.glColor3f(0,1,0);
+ gl.glBegin(gl.GL_LINES);
+ e.glVertices(gl);
+ gl.glEnd();
+ gl.glColor3f(1,0,0);
+ gl.glBegin(gl.GL_LINES);
+ e.pair.glVertices(gl);
+ gl.glEnd();
+ }
+ /*
+ if (closestEdge != null) {
+ gl.glColor3f(1,1,0);
+ gl.glBegin(gl.GL_TRIANGLES);
+ Mesh.T t = closestEdge.t;
+ t.p1().glVertex(gl);
+ t.p2().glVertex(gl);
+ t.p3().glVertex(gl);
+ gl.glColor3f(0,1,1);
+ main.transforms[main.whichNeighbor-1].times(closestEdge.t.p1()).glVertex(gl);
+ main.transforms[main.whichNeighbor-1].times(closestEdge.t.p2()).glVertex(gl);
+ main.transforms[main.whichNeighbor-1].times(closestEdge.t.p3()).glVertex(gl);
+ System.out.println("t="
+ +t.p1()+"\n "
+ +t.p2()+"\n "
+ +t.p3()+"\n "
+ );
+ System.out.println("x="
+ +main.transforms[main.whichNeighbor-1].times(t.p1())+"\n "
+ +main.transforms[main.whichNeighbor-1].times(t.p2())+"\n "
+ +main.transforms[main.whichNeighbor-1].times(t.p3())+"\n "
+ );
+ gl.glEnd();
+ }
+ */
+ }
+
+ if (closest.visible) {
+ gl.glDisable(GL.GL_DEPTH_TEST);
+ gl.glColor3f(1,1,0);
+ gl.glBegin(gl.GL_POINTS);
+ closest.getPoint().glVertex(gl);
+ gl.glColor3f(0.5f,0.5f,0);
+ for(Mesh.Vertex v : (Iterable<Mesh.Vertex>)closest.getBoundPeers())
+ if (v!=closest)
+ v.getPoint().glVertex(gl);
+ gl.glEnd();
+
+ if (closest.getBindingConstraint() instanceof Plane) {
+ Plane p = (Plane)closest.getBindingConstraint();
+ Vec v = p.norm();
+ gl.glEnable(gl.GL_BLEND);
+ gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA);
+ gl.glColor4f(1,1,0,0.3f);
+ gl.glBegin(gl.GL_LINES);
+ closest.getPoint().glVertex(gl);
+ v.plus(closest.getPoint()).glVertex(gl);
+ closest.getPoint().glVertex(gl);
+ v.times(-1).plus(closest.getPoint()).glVertex(gl);
+ gl.glEnd();
+ gl.glDisable(gl.GL_BLEND);
+ }
+
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ }