From: Gerardo H. <ma...@us...> - 2007-02-26 19:36:24
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30698/src/org/jrman/geom Modified Files: AffineTransform.java BoundingVolume.java Bounds2f.java Bounds3f.java ClippingVolume.java ConvexHull3f.java MutableBounds2f.java MutableBounds3f.java PerspectiveTransform.java Plane.java Transform.java Log Message: Check for Catmull Clark scheme before trying to instance a Subdivision Mesh. Started reformatting source code to fit in 80 columns, remove tabs and ugly formatting done by Eclipse. Index: Bounds3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds3f.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Bounds3f.java 27 Nov 2005 04:08:38 -0000 1.17 --- Bounds3f.java 26 Feb 2007 19:35:46 -0000 1.18 *************** *** 1,19 **** /* ! Bounds3f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Bounds3f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 42,64 **** public static Bounds3f ALL = ! new Bounds3f( ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY); protected Bounds3f() { // Empty ! this( ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY); } ! public Bounds3f(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax) { minX = xMin; maxX = xMax; --- 42,64 ---- public static Bounds3f ALL = ! new Bounds3f(-Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY); protected Bounds3f() { // Empty ! this(Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY); } ! public Bounds3f(float xMin, float xMax, ! float yMin, float yMax, ! float zMin, float zMax) { minX = xMin; maxX = xMax; *************** *** 86,90 **** public Bounds2f toBounds2f(float margin) { ! return new Bounds2f(minX - margin, maxX + margin, minY - margin, maxY + margin); } --- 86,91 ---- public Bounds2f toBounds2f(float margin) { ! return new Bounds2f(minX - margin, maxX + margin, ! minY - margin, maxY + margin); } *************** *** 122,153 **** public BoundingVolume transform(Transform transform) { - /* - MutableBounds3f mb = new MutableBounds3f(); - p.set(minX, minY, minZ); - transform.transformPoint(p); - mb.addPoint(p); - p.set(minX, minY, maxZ); - transform.transformPoint(p); - mb.addPoint(p); - p.set(minX, maxY, minZ); - transform.transformPoint(p); - mb.addPoint(p); - p.set(minX, maxY, maxZ); - transform.transformPoint(p); - mb.addPoint(p); - p.set(maxX, minY, minZ); - transform.transformPoint(p); - mb.addPoint(p); - p.set(maxX, minY, maxZ); - transform.transformPoint(p); - mb.addPoint(p); - p.set(maxX, maxY, minZ); - transform.transformPoint(p); - mb.addPoint(p); - p.set(maxX, maxY, maxZ); - transform.transformPoint(p); - mb.addPoint(p); - return mb; - */ ConvexHull3f c = new ConvexHull3f(); c.addPoint(minX, minY, minZ); --- 123,126 ---- *************** *** 249,254 **** public String toString() { StringBuffer sb = new StringBuffer(); ! sb ! .append('[') .append(minX) .append(" ") --- 222,226 ---- public String toString() { StringBuffer sb = new StringBuffer(); ! sb.append('[') .append(minX) .append(" ") Index: Transform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Transform.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Transform.java 17 Aug 2003 22:05:39 -0000 1.6 --- Transform.java 26 Feb 2007 19:35:46 -0000 1.7 *************** *** 1,19 **** /* ! Transform.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Transform.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Bounds2f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds2f.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Bounds2f.java 10 May 2003 03:57:28 -0000 1.9 --- Bounds2f.java 26 Feb 2007 19:35:46 -0000 1.10 *************** *** 1,19 **** /* ! Bounds2f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Bounds2f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 49,53 **** protected Bounds2f() { // Empty ! this(Constants.INFINITY, -Constants.INFINITY, Constants.INFINITY, -Constants.INFINITY); } --- 49,54 ---- protected Bounds2f() { // Empty ! this(Constants.INFINITY, -Constants.INFINITY, ! Constants.INFINITY, -Constants.INFINITY); } *************** *** 116,121 **** StringBuffer sb = new StringBuffer(); sb.append("Bounds2f"); ! sb.append(", min: ").append('(').append(minX).append(", ").append(minY).append(')'); ! sb.append(", max: ").append('(').append(maxX).append(", ").append(maxY).append(')'); return sb.toString(); } --- 117,124 ---- StringBuffer sb = new StringBuffer(); sb.append("Bounds2f"); ! sb.append(", min: ").append('(').append(minX) ! .append(", ").append(minY).append(')'); ! sb.append(", max: ").append('(').append(maxX) ! .append(", ").append(maxY).append(')'); return sb.toString(); } Index: BoundingVolume.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/BoundingVolume.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BoundingVolume.java 16 Jul 2003 07:20:49 -0000 1.7 --- BoundingVolume.java 26 Feb 2007 19:35:46 -0000 1.8 *************** *** 1,19 **** /* ! BoundingVolume.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! BoundingVolume.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Plane.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Plane.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Plane.java 18 May 2003 20:10:50 -0000 1.4 --- Plane.java 26 Feb 2007 19:35:46 -0000 1.5 *************** *** 1,19 **** /* ! Plane.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Plane.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 54,58 **** } ! public static Plane createWithPointAndNormal(Point3f point, Vector3f normal) { return new Plane(new Point3f(point), new Vector3f(normal)); } --- 54,59 ---- } ! public static Plane createWithPointAndNormal(Point3f point, ! Vector3f normal) { return new Plane(new Point3f(point), new Vector3f(normal)); } Index: ClippingVolume.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/ClippingVolume.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClippingVolume.java 18 May 2003 20:10:50 -0000 1.4 --- ClippingVolume.java 26 Feb 2007 19:35:46 -0000 1.5 *************** *** 1,19 **** /* ! ClippingVolume.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! ClippingVolume.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AffineTransform.java 20 Sep 2004 21:09:05 -0000 1.15 --- AffineTransform.java 26 Feb 2007 19:35:46 -0000 1.16 *************** *** 1,19 **** /* ! AffineTransform.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! AffineTransform.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 50,99 **** public static Transform createOrthographic(float near, float far) { Matrix4f m = ! new Matrix4f(1f, 0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1, //1f / (far - near), ! 0f, //-near / (far - near), ! 0f, 0f, 0f, 1f); ! return new AffineTransform(m); } ! public static Transform createRaster( ! Bounds2f screenWindow, ! float frameAspectRatio, ! int horizontalResolution, ! int verticalResolution, ! float pixelAspectRatio) { float imageAspectRatio = (horizontalResolution * pixelAspectRatio) / verticalResolution; if (imageAspectRatio < frameAspectRatio) verticalResolution = ! (int) ((horizontalResolution * pixelAspectRatio) / frameAspectRatio); else if (imageAspectRatio > frameAspectRatio) horizontalResolution = ! (int) ((verticalResolution * frameAspectRatio) / pixelAspectRatio); // Doesn't handle "flipped" screen window Point2f min = screenWindow.getMin(); Point2f max = screenWindow.getMax(); ! Matrix4f m = ! new Matrix4f( ! horizontalResolution / (max.x - min.x), ! 0f, ! 0f, ! 0f, ! 0f, ! verticalResolution / (max.y - min.y), ! 0f, ! 0f, ! 0f, ! 0f, ! 1f, ! 0f, ! 0f, ! 0f, ! 0f, ! 1f); Matrix4f tmp = new Matrix4f(); tmp.setIdentity(); tmp.setTranslation(new Vector3f(0f, max.y - min.y, 0f)); m.mul(tmp); ! tmp = new Matrix4f(1f, 0f, 0f, 0f, 0f, -1f, 0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1f); m.mul(tmp); tmp.setIdentity(); --- 50,102 ---- public static Transform createOrthographic(float near, float far) { Matrix4f m = ! new Matrix4f(1f, 0f, 0f, 0f, ! 0f, 1f, 0f, 0f, ! 0f, 0f, 1, 0f, //1f/(far-near),-near/(far-near), ! 0f, 0f, 0f, 1f); ! return new AffineTransform(m); } ! public static Transform createRaster(Bounds2f screenWindow, ! float frameAspectRatio, ! int horizontalResolution, ! int verticalResolution, ! float pixelAspectRatio) { float imageAspectRatio = (horizontalResolution * pixelAspectRatio) / verticalResolution; if (imageAspectRatio < frameAspectRatio) verticalResolution = ! (int) ((horizontalResolution * pixelAspectRatio) / ! frameAspectRatio); else if (imageAspectRatio > frameAspectRatio) horizontalResolution = ! (int) ((verticalResolution * frameAspectRatio) / ! pixelAspectRatio); // Doesn't handle "flipped" screen window Point2f min = screenWindow.getMin(); Point2f max = screenWindow.getMax(); ! Matrix4f m = new Matrix4f(horizontalResolution / (max.x - min.x), ! 0f, ! 0f, ! 0f, ! 0f, ! verticalResolution / (max.y - min.y), ! 0f, ! 0f, ! 0f, ! 0f, ! 1f, ! 0f, ! 0f, ! 0f, ! 0f, ! 1f); Matrix4f tmp = new Matrix4f(); tmp.setIdentity(); tmp.setTranslation(new Vector3f(0f, max.y - min.y, 0f)); m.mul(tmp); ! tmp = new Matrix4f(1f, 0f, 0f, 0f, ! 0f, -1f, 0f, 0f, ! 0f, 0f, 1f, 0f, ! 0f, 0f, 0f, 1f); m.mul(tmp); tmp.setIdentity(); *************** *** 103,129 **** } ! public static Transform createNDC(int horizontalResolution, int verticalResolution) { Matrix4f m = ! new Matrix4f( ! 1f / horizontalResolution, ! 0f, ! 0f, ! 0f, ! 0f, 1f / verticalResolution, ! 0f, ! 0f, ! 0f, ! 0f, ! 1f, ! 0f, ! 0f, ! 0f, ! 0f, ! 1f); return new AffineTransform(m); } ! public static Transform readFromFile(DataInputStream dis) throws IOException { float a = dis.readFloat(); float b = dis.readFloat(); --- 106,133 ---- } ! public static Transform createNDC(int horizontalResolution, ! int verticalResolution) { Matrix4f m = ! new Matrix4f(1f / horizontalResolution, ! 0f, ! 0f, ! 0f, ! 0f, 1f / verticalResolution, ! 0f, ! 0f, ! 0f, ! 0f, ! 1f, ! 0f, ! 0f, ! 0f, ! 0f, ! 1f); return new AffineTransform(m); } ! public static Transform readFromFile(DataInputStream dis) ! throws IOException { float a = dis.readFloat(); float b = dis.readFloat(); *************** *** 142,146 **** float o = dis.readFloat(); float p = dis.readFloat(); ! Matrix4f mat = new Matrix4f(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p); return new AffineTransform(mat); } --- 146,153 ---- float o = dis.readFloat(); float p = dis.readFloat(); ! Matrix4f mat = new Matrix4f(a, b, c, d, ! e, f, g, h, ! i, j, k, l, ! m, n, o, p); return new AffineTransform(mat); } Index: MutableBounds2f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/MutableBounds2f.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MutableBounds2f.java 20 May 2003 01:08:37 -0000 1.3 --- MutableBounds2f.java 26 Feb 2007 19:35:46 -0000 1.4 *************** *** 1,19 **** /* ! MutableBounds2f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! MutableBounds2f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: ConvexHull3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/ConvexHull3f.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ConvexHull3f.java 14 Nov 2005 02:51:32 -0000 1.16 --- ConvexHull3f.java 26 Feb 2007 19:35:46 -0000 1.17 *************** *** 1,19 **** /* ! Polyhedron3f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! ConvexHull3f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: MutableBounds3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/MutableBounds3f.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MutableBounds3f.java 30 Nov 2003 03:23:16 -0000 1.4 --- MutableBounds3f.java 26 Feb 2007 19:35:46 -0000 1.5 *************** *** 1,19 **** /* ! MutableBounds3f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! MutableBounds3f.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: PerspectiveTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/PerspectiveTransform.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PerspectiveTransform.java 6 Jul 2005 22:53:23 -0000 1.12 --- PerspectiveTransform.java 26 Feb 2007 19:35:46 -0000 1.13 *************** *** 1,19 **** /* ! PerspectiveTransform.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! PerspectiveTransform.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 38,50 **** private float far; ! public static PerspectiveTransform createWithFov(float fov, float near, float far) { return createWithFocalLength(Calc.fovToFocalLength(fov), near, far); } ! public static PerspectiveTransform createWithFocalLength(float focalLength, float near, float far) { return new PerspectiveTransform(focalLength, near, far); } ! public static Transform readFromFile(DataInputStream dis) throws IOException { float a = dis.readFloat(); float b = dis.readFloat(); --- 38,54 ---- private float far; ! public static PerspectiveTransform createWithFov(float fov, ! float near, float far) { return createWithFocalLength(Calc.fovToFocalLength(fov), near, far); } ! public static PerspectiveTransform createWithFocalLength(float focalLength, ! float near, ! float far) { return new PerspectiveTransform(focalLength, near, far); } ! public static Transform readFromFile(DataInputStream dis) ! throws IOException { float a = dis.readFloat(); float b = dis.readFloat(); *************** *** 63,67 **** float o = dis.readFloat(); float p = dis.readFloat(); ! Matrix4f mat = new Matrix4f(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o ,p); float near = dis.readFloat(); float far = dis.readFloat(); --- 67,74 ---- float o = dis.readFloat(); float p = dis.readFloat(); ! Matrix4f mat = new Matrix4f(a, b, c, d, ! e, f, g, h, ! i, j, k, l, ! m, n, o ,p); float near = dis.readFloat(); float far = dis.readFloat(); *************** *** 76,86 **** private PerspectiveTransform(float fl, float near, float far) { ! super( ! new Matrix4f( ! fl, 0f, 0f, 0f, ! 0f, fl, 0f, 0f, ! // 0f, 0f, far / (far - near), (far * near) / (near - far), ! 0f, 0f, 1f, -1f, ! 0f, 0f, 1f, 0f)); this.near = near; this.far = far; --- 83,91 ---- private PerspectiveTransform(float fl, float near, float far) { ! super(new Matrix4f(fl, 0f, 0f, 0f, ! 0f, fl, 0f, 0f, ! // 0f, 0f, far/(far-near), (far*near) / (near-far), ! 0f, 0f, 1f, -1f, ! 0f, 0f, 1f, 0f)); this.near = near; this.far = far; *************** *** 104,108 **** public Transform preConcat(Transform transform) { ! Transform perspective = new PerspectiveTransform(transform.getMatrix(), near, far); return perspective.concat(this); } --- 109,114 ---- public Transform preConcat(Transform transform) { ! Transform perspective = new PerspectiveTransform(transform.getMatrix(), ! near, far); return perspective.concat(this); } |