checkpoint
authoradam <adam@megacz.com>
Thu, 6 Dec 2007 00:49:49 +0000 (16:49 -0800)
committeradam <adam@megacz.com>
Thu, 6 Dec 2007 00:49:49 +0000 (16:49 -0800)
darcs-hash:20071206004949-5007d-90fa2d799287d94f4de4635b4d0287d170504359.gz

src/edu/berkeley/qfat/Main.java
src/edu/berkeley/qfat/Mesh.java
src/edu/berkeley/qfat/MeshViewer.java

index 7eb7b09..f2e3cc4 100644 (file)
@@ -63,12 +63,6 @@ public class Main extends MeshViewer {
             new Matrix(new Vec(rshift,  depth,    halfup)),
             new Matrix(new Vec(lshift, -depth,    halfup)),
             new Matrix(new Vec(rshift, -depth,    halfup)),
-            /*
-            new Matrix(new Vec(lshift,  depth,   -halfup)),
-            new Matrix(new Vec(rshift,  depth,   -halfup)),
-            new Matrix(new Vec(lshift, -depth,   -halfup)),
-            new Matrix(new Vec(rshift, -depth,   -halfup)),
-            */
 
             new Matrix(new Vec(lshift,       0,  height)),
             new Matrix(new Vec(rshift,       0,  height)),
@@ -77,6 +71,7 @@ public class Main extends MeshViewer {
 
             new Matrix(new Vec( width,           0,    0)),
             new Matrix(new Vec(-width,           0,    0)),
+
         };
 
 
@@ -249,19 +244,20 @@ public class Main extends MeshViewer {
     }
 
     public synchronized void rand(float temp, Mesh.Vert p) {
-        double tile_score = tile.score();
-        double goal_score = goal.score();
 
         //p.reComputeError();
         p.reComputeErrorAround();
+        double tile_score = tile.score();
+        double goal_score = goal.score();
 
-        Vec v = new Vec((random.nextFloat() - (float)0.5) / 400,
-                        (random.nextFloat() - (float)0.5) / 400,
-                        (random.nextFloat() - (float)0.5) / 400);
+        Vec v = new Vec((random.nextFloat() - (float)0.5) / 200,
+                        (random.nextFloat() - (float)0.5) / 200,
+                        (random.nextFloat() - (float)0.5) / 200);
         /*
         Matrix inv = p.errorQuadric();
-        Vec v = new Vec(inv.d, inv.h, inv.l).norm().times(1/(float)1000);
+        v = new Vec(inv.d, inv.h, inv.l).norm().times(1/(float)1000);
         */
+
         boolean good = p.move(v);
 
         p.reComputeErrorAround();
@@ -302,7 +298,8 @@ public class Main extends MeshViewer {
             if (breaks) {
                 breaks = false;
                     breakit();
-                    gamma = 2;
+                    gamma = 1;
+                    //gamma = 2;
                     //temp = last * 0.8f;
                     //last = temp;
                     //temp = hightemp;
@@ -318,7 +315,8 @@ public class Main extends MeshViewer {
                     gamma = 0.95f;
                 } else {
                     breakit();
-                    gamma = 2;
+                    //gamma = 2;
+                    gamma = 1;
                     //temp = last * 0.8f;
                     //last = temp;
                     //temp = hightemp;
index 46c2200..3696c0b 100644 (file)
@@ -247,7 +247,7 @@ public class Mesh implements Iterable<Mesh.T> {
                 oldscore = (quadric.preAndPostMultiply(p) * 100) / quadric_count;
             }
 
-            oldscore = oldscore*oldscore;
+            oldscore = oldscore;
 
             int numaspects = 0;
             float aspects = 0;
@@ -260,12 +260,13 @@ public class Mesh implements Iterable<Mesh.T> {
                     aspects += e.t.aspect()*e.t.aspect();
                 }
 
-                if (ang > Math.PI * 0.8)
-                    oldscore += (ang - (Math.PI*0.8)) * 10;
+                float minangle = (float)(Math.PI * 0.3);
+                if (ang > minangle)
+                    oldscore += (ang - minangle);
 
                 e = e.pair.next;
             } while (e != this.e);
-            if (numaspects > 0) oldscore += (aspects / numaspects);
+            //if (numaspects > 0) oldscore += (aspects / numaspects);
 
             //System.out.println(oldscore);
             //oldscore = oldscore*oldscore;
@@ -793,11 +794,11 @@ public class Mesh implements Iterable<Mesh.T> {
         public boolean has(Vert v) { return v1()==v || v2()==v || v3()==v; }
 
         public void glVertices(GL gl) {
-
+            /*
             if (e1().bind_to.set.size() == 0) return;
             if (e2().bind_to.set.size() == 0) return;
             if (e3().bind_to.set.size() == 0) return;
-
+            */
             norm().glNormal(gl);
             p1().glVertex(gl);
             p2().glVertex(gl);
index 96680be..fdbb1c7 100644 (file)
@@ -168,7 +168,7 @@ public class MeshViewer implements GLEventListener, MouseListener, MouseMotionLi
             green -= .12f;
             blue -= .15f;
 
-            if (triangles) switch(t.color/*class*/) {
+            if (triangles) switch(t.colorclass) {
                 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;