Here is one way to overkill the problem using Vector3d's,  Matrix3d mat,
Transform3D trans, and
        viewTrans = universe.getViewingPlatform().getViewPlatformTransform();

        locVw.set( -0.6, -3.5, -0.1);       // View location in WC
        yVw.set( 0.0, 1.0, 0.0);            // View up direction in WC ( !=
+- zVw !!!)
        zVw.set( locVw);  zVw.sub( COPw);   // View Z axis is -lookat direction
        xVw.cross( yVw, zVw);               // View X axis in WC
        yVw.cross( zVw, xVw);               // ensure orthogonality
        xVw.normalize();  yVw.normalize();  zVw.normalize();
        mat.setColumn( 0, xVw);
        mat.setColumn( 1, yVw);
        mat.setColumn( 2, zVw);
        trans.set( mat, locVw, 1.0);
        viewTrans.setTransform( trans);

but I think lookat is supposed to do this for you, and probably more efficient.
Notice that the transform transforms points expressed in View coords to points
in world coords.

Mike









At 06:40 PM 9/6/00 +0300, you wrote:
>On Wed, 6 Sep 2000, Ben Arbel wrote:
>
>>hi all
>>
>>im getting a strange exception (non congruent transform above viewPlatform)
>>when setting a transform3d to a transformGroup did any one encounter it
>>before ? i will be happy to supply extra explanations for what im doing
>>before that exeption or send an exmple code if you think it can help you
>>figure out whats going on.
>>
>
> Hi,
>
>  I've had some trouble with that, too.
>
>The problem should be exactly what the error message says. The transform3d
>you set is non-congruent, meaning that it does something you can't do with
>any combination of rotation, translation and mirroring (scale of -1).
>
> Unfortunately, there is a bug in J3D that classifies mirroring
>transformations as non-congruent. So until next release,
>you (and I) have to use only rotation and translation in transforms
>above viewplatform (and also in transforms in View object, at least
>in compatibility mode)
>
> If you do lots of strange matrix calculations, it is possible that some
>rounding error accumulates in your matrix and tweaks it enough to make
>it non-rigid. But probably it's the bug.
>
>
>-- Matti Hietaj�rvi
>   University of Oulu
>   Finland
>   +358 8 553 2811
>
>===========================================================================
>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".
>

===========================================================================
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