Hi Wei,

> I used Transform3D.frustum(...) object for transformation. The
TransformGroup node is used as an ancestor of a ViewPlatform node in the
SimpleUniverse. When I run the application, there is a
BadTransformException: TransformGroup: no-affine transform. Can anyone show
me how to make this transform affine?

Some time ago we discovered a similar problem with Transform3D.ortho(..). I
think this problem is fixed in newer J3D versions, but I am not sure about
this, since there is an easy bug fix (please tell me if it works with
frustum):
[26.11.99] ... included is some code which shows our problem: a Transform3D
set
with the ortho(..) function is not affine, but after reset with (nearly) the
same values with the set(..) function it seems to be okay.

code:
    TransformGroup tg = new TransformGroup();
    Transform3D t3d = new Transform3D();
    float[] m = new float[16];
    t3d.ortho(0.0, 10.0, 0.0, 10.0, -1.0, 1.0);
    System.out.println(t3d.getBestType());
    System.out.println(t3d);
    try {
      tg.setTransform(t3d);
    }
    catch(Exception e) {
      System.out.println(e.getMessage()+"\n");
    }
    t3d.get(m);
    t3d.set(m);
    System.out.println(t3d.getBestType());
    System.out.println(t3d);
    try {
      tg.setTransform(t3d);
    }
    catch(Exception e) {
      System.out.println(e.getMessage()+"\n");
    }

output:
0
0.2, 0.0, 0.0, -1.0
0.0, 0.2, 0.0, -1.0
0.0, 0.0, 1.0, 0.0
0.0, 0.0, 0.0, 1.0
TransformGroup: non-affine transform

128
0.20000000298023224, 0.0, 0.0, -1.0
0.0, 0.20000000298023224, 0.0, -1.0
0.0, 0.0, 1.0, 0.0
0.0, 0.0, 0.0, 1.0

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to