X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMain.java;h=e7ee361a298601cf874cc38242f151f99e587eb2;hp=75b3f124ae755fa3e7840a4eb9294d26371646a7;hb=1cfea6e5d6ca9e75578e97d1fdccf2b306af56c4;hpb=a834467308680ec7fc4a82e2f5998b85784a7572 diff --git a/src/edu/berkeley/qfat/Main.java b/src/edu/berkeley/qfat/Main.java index 75b3f12..e7ee361 100644 --- a/src/edu/berkeley/qfat/Main.java +++ b/src/edu/berkeley/qfat/Main.java @@ -6,11 +6,37 @@ import javax.swing.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; import java.util.*; +import edu.berkeley.qfat.bind.*; import edu.berkeley.qfat.geom.*; import edu.berkeley.qfat.geom.Point; import edu.berkeley.qfat.geom.Polygon; // TO DO: +// +// - Implement "real" constraints (plane, line, point) +// +// - Constrained surface subdivision +// - Edge.flip() gets us the triforce subdivision +// - Edge.delete() gets us the catmull-clark subdivision +// - Catmull-Clark: just don't move points if we can't. Need to average the influence of the points on a binding group. +// +// - Ability to snap three views to orthgonal +// - SLIDE UI +// - left button -> crystal ball +// - translate +// - rightbutton/mousewheel zoom +// - v+click to select vertex +// - show: constraints, bindings, faces +// +// Editing: +// - fracture edge, face +// - change aspect ratio +// - ability to select a point, rotate the model, then move the point +// - when moving a vertex in one window, show that window's axes in all other windows +// + + +// TO DO: // - real anneal // - solve self-intersection problem // - get a better test model? @@ -52,7 +78,7 @@ import edu.berkeley.qfat.geom.Polygon; public class Main extends InteractiveMeshViewer { - public Matrix[] transforms; + public static int verts = 1; @@ -72,7 +98,7 @@ public class Main extends InteractiveMeshViewer { if (v.mag() < 0.0001) continue; v = v.times(-1); v = v.times(0.5f); - Point p = Point.ORIGIN.plus(v); + Point p = Point.ZERO.plus(v); v = v.times(-1); //System.out.println(v); @@ -81,7 +107,7 @@ public class Main extends InteractiveMeshViewer { polygons.add(new Polygon(hs)); } for(Polygon p : polygons) { - System.out.println(p.plane.norm + " " + p.plane.dvalue); + System.out.println(p.plane.norm() + " " + p.plane.d); for(HalfSpace hs : halfSpaces) { if (p.plane==hs) continue; p = p.intersect(hs); @@ -496,9 +522,9 @@ public class Main extends InteractiveMeshViewer { es.add(t.e3()); } for(Mesh.E e : es) { - if (e.p1.p.x == e.p2.p.x && e.p1.p.y == e.p2.p.y) continue; - if (e.p1.p.z == e.p2.p.z && e.p1.p.y == e.p2.p.y) continue; - if (e.p1.p.x == e.p2.p.x && e.p1.p.z == e.p2.p.z) continue; + if (e.v1.p.x == e.v2.p.x && e.v1.p.y == e.v2.p.y) continue; + if (e.v1.p.z == e.v2.p.z && e.v1.p.y == e.v2.p.y) continue; + if (e.v1.p.x == e.v2.p.x && e.v1.p.z == e.v2.p.z) continue; e.shatter(); } transforms = new Matrix[] { @@ -759,7 +785,7 @@ public class Main extends InteractiveMeshViewer { //Matrix m = Matrix.scale(1f, 2.1f, 1f); tile.transform(m); for(int i=0; i