Andrew,
This may not answer your question directly,but it may help.


The following is a code snippet (courtesy of Thomas Auinger)
which sets the viewplatform looking at the origin while rotating
in a circle.It inverts the transform just before applying it to the view
object.
----------------------------------------------------------------------------
-----------
Transform3D.lookAt(Point3d eye,
                   Point3d center,
                   Vector3d up)

is fine. Just remember, to INVERT the transform before
assigning it to the TransformGroup, that holds your ViewPlatform.

Following is a code snipplet I use to have the camera move in
a circle while always looking the the circle center:

    public void calcViewpoint()
    {   Transform3D viewpoint = new Transform3D();
// 'angle' describes the current position on the circle
// while 'distance' is the circle's radius.
        double  eyeX = Math.cos(angle) * distance,
                eyeZ = Math.sin(angle) * distance;
        Point3d  eyeLocation = new  Point3d(eyeX, 0.0d, eyeZ);
        Point3d  lookingAt   = new  Point3d(0.0d, 0.0d, 0.0d);
        Vector3d up          = new Vector3d(0.0d, 1.0d, 0.0d);
        viewpoint.lookAt(eyeLocation, lookingAt, up);
        viewpoint.invert();

        viewTransformGroup.setTransform(viewpoint);
    }

----------------------------------------------------------------------------
---------------
It works fine.

Hope this helps a bit.



Daryle.






-----Original Message-----
From: Andrew n marshall <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, July 07, 1999 9:17 AM
Subject: [JAVA3D] Transfrom3D.lookAt()


>I have a avatar that needs to be able to look at other objects in the
>scene I imported from the VRML97 loader.  I've been trying to use the
>Transform3D.lookAt() method, but I've been getting lots of bad results.
>According to these messages:
>  http://www.javasoft.com/products/java-media/mail-archive/3D/0280.html
>  http://www.javasoft.com/products/java-media/mail-archive/3D/1472.html
>...the lookAt method is really that buggy.
>
>However, this message:
>  http://www.javasoft.com/products/java-media/mail-archive/3D/1495.html
>...suggests that I could invert the transform to get it to work.  I
>tried it, but I got a transform that was almost correct, but faced the
>wrong direction (PI around the y-axis).
>
>If the need for the inversion was intentional, can someone explain the
>design decision to me.  It doesn't make sense to me since, unlike
>OpenGL, the world is not centered on the camera, so all uses of the
>lookAt() method (cameras and external avatars) would need to be
>inverted.
>
>
>Thanks.
>
>
>Anm
>
>===========================================================================
>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