Received: from mail.java.sun.com (mail.javasoft.com [204.160.241.28])
	by cis.ohio-state.edu (8.9.1/8.9.1) with ESMTP id WAA04507
	for <muniandy@CIS.OHIO-STATE.EDU>; Tue, 6 Jul 1999 22:29:43 -0400 (EDT)
Received: from mail (mail.java.sun.com [204.160.241.28])
	by mail.java.sun.com (8.9.0.Beta6+Sun/8.9.0) with ESMTP id TAA24945;
	Tue, 6 Jul 1999 19:06:47 -0700 (PDT)
Received: from JAVA.SUN.COM by JAVA.SUN.COM (LISTSERV-TCP/IP release 1.8d) with
          spool id 1746363 for JAVA3D-INTEREST@JAVA.SUN.COM; Tue, 6 Jul 1999
          19:06:35 -0700
Received: from cia.com.au ([203.17.36.22]) by mail.java.sun.com
          (8.9.0.Beta6+Sun/8.9.0) with SMTP id TAA24691 for
          <JAVA3D-INTEREST@java.sun.com>; Tue, 6 Jul 1999 19:00:52 -0700 (PDT)
Received: (qmail 21532 invoked from network); 7 Jul 1999 02:07:10 -0000
Received: from unknown (HELO daryles) (203.28.48.181) by cia.com.au with SMTP;
          7 Jul 1999 02:07:10 -0000
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID:  <002d01bec81d$82526fc0$145ffea9@daryles>
Date:         Wed, 7 Jul 1999 12:07:47 +1000
Reply-To: Discussion list for Java 3D API <JAVA3D-INTEREST@JAVA.SUN.COM>
Sender: Discussion list for Java 3D API <JAVA3D-INTEREST@JAVA.SUN.COM>
From: Daryle Singh <daryles@CIA.COM.AU>
Subject:      Re: [JAVA3D] Transfrom3D.lookAt()
To: JAVA3D-INTEREST@JAVA.SUN.COM
X-UIDL: 875e8958d2f771b24af5c05a04eb7cb2

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 <amarshal@USC.EDU>
To: JAVA3D-INTEREST@JAVA.SUN.COM <JAVA3D-INTEREST@JAVA.SUN.COM>
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 listserv@java.sun.com and include in the body
>of the message "signoff JAVA3D-INTEREST".  For general help, send email to
>listserv@java.sun.com and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

