It may be "just a bug", as you say. I was getting that exception. In my case it was due to a Transform3D bug which they say won't be fixed until the next release after 1.1.2. The source of the problem is that when a Transform3D is set from a Matrix4d the Transform3D does not always correctly determine the type of matrix. See my included test code. -ellery- Tony Burrows wrote: > > At 10:33 09/06/99 -0400, you wrote: > >On Tue, 8 Jun 1999, Tony Burrows wrote: > > > >> At 13:07 08/06/99 -0400, you wrote: > >> >Hi, > >> > > >> >I have a behavior that changes rotation (in x, y and z) and translation > >> >(in x and z) above ViewPlatform. Basically, it acts like a camera > >> >orientation/position controller. It works most of the time but sometimes, > >> >I get "BadTransformException: non-congruent transform above ViewPlatform" > >> >error message. I seem to get this randomly. Please let me know what's > >> >causing this and anyway of fixing this. Thanks in advance. > >> > > >> >-Tachio > >> 'non-congruent transform means' that you are scaling differently on the > >> axes Tachio (rather than translating). This is OK on the object side of > >> the scene graph, but is not allowed on the view side. Somewhere in the API > >> specs (and I can't remember where) it says that trying to scale the view > >> platform transform in a non-uniform way is not allowed, so you get the > >> exception. > >> > >> Tony > > > >That's strange, I have only rotation/translation transforms above > >ViewPlatform. Well, I hope it was a bug in 1.1.1 which 1.1.2 fixed. > > > >-Tachio > > > A bug in the API is quite possible Tachio - it wouldn't be the first. And > I suppose there could be some other reason for the exception - hard to tell > without the code. But 'non-congruent' does mean scaling according to the > published API and my maths books. I'm far from an expert in matrix > operations though. Maybe there's someone out there who can suggest how a > scaling can be produced from other ops. if it isn't just a bug. > > Tony > > ===================================================================== > To subscribe/unsubscribe, send mail to [EMAIL PROTECTED] > Java 3D Home Page: http://java.sun.com/products/java-media/3D/ -- Ellery Chan <[EMAIL PROTECTED]> Harris ISD, Melbourne, FL 32904 Voice: 407-984-6506, Fax: 407-984-6353
Hi Ellery, You have discovered a bug in the Java 3D implementation. Thanks for bringing it to our attention. Unfortunately, a fix for this will not make our 1.1.2 release, which should be on the web soon. -- Kevin Rushforth Java 3D Team Sun Microsystems [EMAIL PROTECTED] >From: "Ellery Chan" <[EMAIL PROTECTED]> >Date: Sun, 30 May 1999 00:50:50 -0400 > >I've been trying to use the lookAt() method of Transform3D, but when I >retrieve the transformation matrix and restore it later, the >transformation type flags don't seem to be getting computed correctly. >I don't think they get set correctly after the lookAt() either. Am I >misunderstanding the type flags, or is there something wrong here? > >Here's my little test app. Can anyone explain the observed behavior? > > >//********************************************************************** >******* >// CLASS: T3DBugTest >// This class tests for existence of a bug in Transform3D where the >transform >// type is not properly set when a matrix is used to initialize the >// Transform3D node. The lookAt() transformation doesn't seem to >update the >// type flags correctly, and neither does setting the Transform3D from >a >// matrix. >// >// Generated output (JDK 1.2.1, J3D 1.1.1): >// AFFINE|CONGRUENT|IDENTITY|ORTHOGONAL|RIGID|SCALE| >// AFFINE|CONGRUENT|IDENTITY|ORTHOGONAL|RIGID|SCALE| >// AFFINE|CONGRUENT|IDENTITY|ORTHOGONAL|RIGID|SCALE| >// AFFINE| >// >//********************************************************************** >******* >import javax.media.j3d.Transform3D; >import javax.vecmath.Matrix4d; >import javax.vecmath.Point3d; >import javax.vecmath.Quat4d; >import javax.vecmath.Vector3d; > >public class T3DBugTest >{ > public T3DBugTest () > { > final Transform3D t1 = new Transform3D(); > final Transform3D t2 = new Transform3D(); > final Matrix4d mat = new Matrix4d(); > > pType(t1); // AFFINE|CONGRUENT|IDENTITY|ORTHOGONAL|RIGID|SCALE > t1.lookAt(new Point3d(50,20,50), new Point3d(0,0,0), new >Vector3d(0,1,0)); > pType(t1); // AFFINE|CONGRUENT|IDENTITY|ORTHOGONAL|RIGID|SCALE > // (Should be AFFINE|CONGRUENT|RIGID, I think) > t1.get(mat); > > pType(t2); // AFFINE|CONGRUENT|IDENTITY|ORTHOGONAL|RIGID|SCALE > t2.set(mat); // should recompute type from matrix > pType(t2); // AFFINE (Should be whatever t1 was!) > } > > public void pType (Transform3D t) > { > final int flags = t.getType(); > if ((flags & Transform3D.AFFINE) != 0) >System.err.print("AFFINE|"); > if ((flags & Transform3D.CONGRUENT) != 0) >System.err.print("CONGRUENT|"); > if ((flags & Transform3D.IDENTITY) != 0) >System.err.print("IDENTITY|"); > if ((flags & Transform3D.NEGATIVE_DETERMINANT) != 0 ) >System.err.print("NEGATIVE_DETERMINANT|"); > if ((flags & Transform3D.ORTHOGONAL) != 0 ) >System.err.print("ORTHOGONAL|"); > if ((flags & Transform3D.RIGID) != 0) System.err.print("RIGID|"); > if ((flags & Transform3D.SCALE) != 0) System.err.print("SCALE|"); > if ((flags & Transform3D.TRANSLATION) != 0) >System.err.print("TRANSLATION|"); > if ((flags & Transform3D.ZERO) != 0) System.err.print("ZERO|"); > System.err.println(""); > } > > public final static void main (String[] args) > { > new T3DBugTest(); > } >} > >-- >Ellery Chan >Harris Corp. >[EMAIL PROTECTED] > > >===================================================================== >To subscribe/unsubscribe, send mail to [EMAIL PROTECTED] >Java 3D Home Page: http://java.sun.com/products/java-media/3D/ > ===================================================================== To subscribe/unsubscribe, send mail to [EMAIL PROTECTED] Java 3D Home Page: http://java.sun.com/products/java-media/3D/
