- lastGL = gl;
- GLU glu = new GLU();
- gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- gl.glPointSize(5.0f);
- gl.glLoadIdentity();
- glu.gluPerspective(50, ((float)drawable.getWidth())/drawable.getHeight(), 0.5, 10);
- glu.gluLookAt(0, 0, -((tz/10)-1), 0, 0, 0, 0, 1, 0);
- gl.glRotatef(anglex/3, 0, 1, 0);
- gl.glRotatef(-(angley/3), 1, 0, 0);
-
-
- gl.glDisable(GL.GL_LIGHTING);
- gl.glColor4f(1, 0, 0, 1);
- gl.glBegin(GL.GL_LINES);
- gl.glVertex3f(0,0,0);
- gl.glVertex3f(.3f,0,0);
- gl.glEnd();
- gl.glColor4f(0, 1, 0, 1);
- gl.glBegin(GL.GL_LINES);
- gl.glVertex3f(0,0,0);
- gl.glVertex3f(0,.3f,0);
- gl.glEnd();
- gl.glColor4f(0, 0, 1, 1);
- gl.glBegin(GL.GL_LINES);
- gl.glVertex3f(0,0,0);
- gl.glVertex3f(0,0,.3f);
- gl.glEnd();
- gl.glEnable(GL.GL_LIGHTING);
-
-
- gl.glBegin(GL.GL_TRIANGLES);
- if (tileon)
- draw(gl, true, safeTriangles);
- if (tilemeshon)
- draw(gl, false, safeTriangles);
- gl.glEnd();
-
- //draw(gl, false, tile);
-
- gl.glBegin(GL.GL_TRIANGLES);
- gl.glColor4f((float)0.5, (float)0.5, (float)0.5, (float)0.8);
- if (goalon)
- draw(gl, false, goal);
- gl.glEnd();
-
-
- int i = 0;
- //gl.glDisable(GL.GL_DEPTH_TEST);
- gl.glColor4f(1,1,1,1);
- for(Matrix m : transforms) {
- /*
- gl.glColor4f(0, 1, 1, 1);
- gl.glBegin(GL.GL_LINES);
- new Point(0,0,0).glVertex(gl);
- new Point(0,0,0).plus(m.getTranslationalComponent()).glVertex(gl);
- gl.glEnd();
- gl.glEnable(GL.GL_LIGHTING);
- */
- //if (v1.z==0 && v1.y==0) continue;
- i++;
- if (neighborsWireOne && i!=whichNeighbor) continue;
- //if (i>4) continue;
- /*
- Point p = new Point(0, 0, 0).times(m);
- Vec v = new Vec(p.x, p.y, p.z);
- v = v.times((float)1.04);
- gl.glTranslatef(v.x, v.y, v.z);
- */
- if (neighbors) draw(gl, true, safeTriangles, m);
- else if (neighborsWire || neighborsWireOne) draw(gl, false, safeTriangles, m);
- /*
- gl.glTranslatef(-v.x, -v.y, -v.z);
- */
- }
- //gl.glEnable(GL.GL_DEPTH_TEST);
-
- gl.glDisable(GL.GL_LIGHTING);
- gl.glShadeModel(GL.GL_FLAT);
- if (closest != null) {
- gl.glColor3f(1,1,1);
- gl.glBegin(gl.GL_POINTS);
- closest.getPoint().glVertex(gl);
- gl.glEnd();
- /*
- Mesh.Vertex v2 = closest.hack(gl, getMouse());
- gl.glBegin(GL.GL_LINES);
- closest.getPoint().glVertex(gl);
- if (v2 != null) v2.getPoint().glVertex(gl);
- gl.glEnd();
- */
- }