Thanks Justin
Your explanation helped me a lot to understand these issues. I'll go over my
source code and check the matrix out....
I'll let you know how it worked.
Thank you again for your time.
----- Original Message -----
From: "Justin Couch" <[EMAIL PROTECTED]>
To: "Juan Miguel" <[EMAIL PROTECTED]>
Sent: Friday, August 31, 2001 1:23 AM
Subject: Re: Hi justin
> G'day Juan,
>
> > I need a vector known as UP and it's often represented as a unit
vector, in
> > order to set the orientation of the camera.
> > I also need where camera is looking at... the focus point.
>
> So what you need here is values based on where the camera is currently
> looking, rather than trying to set the camera in a particular direction.
>
> What you need to do is get the transform of the VP relative to the world
> coordinates first. This is done by calling getLocalToVworld() of the
> ViewPlatform.
>
> Transform3D vw_tx = new Transform3D();
> viewPlatform.getLocaltoVworld(vw_tx);
>
> This gives you transformation information that will point everything to
> world coordinates from whatever local coordinate system your camera is
> in. Because this is only a transformation it does not contain any real
> information directly. In order to get real information you use this
> matrix to transform something else. So how do you get an Up vector from
> this? Well you have to start with the assumption that "up" is along the
> positive Y axis (right handed coordinate system). Even if your camera is
> looking at the world upside-down, as far as the camera is concerned, up
> is still along it's local +Y axis. What has changed is the parent
> transformation. To find out what your local Y axis is in world
> coordinates, you apply the world transform to a vector that points along
> the local Up direction - ie (0, 1, 0).
>
> Vector3d up_dir = new Vector3d(0, 1, 0);
> vw_tx.transform(up);
>
> up_dir vector now contains the true direction of the camera's "up"
> direction in world coordinates.
>
> You can now apply these same principals to any other information you
> need. For example, a viewplatform always points along the -Z axis in
> it's local coordinate system. To find out which direction it is really
> looking, transform the vector (0, 0, -1) and you have your answer.
>
> --
> Justin Couch http://www.vlc.com.au/~justin/
> Freelance Java Consultant http://www.yumetech.com/
> Author, Java 3D FAQ Maintainer http://www.j3d.org/
> -------------------------------------------------------------------
> "Humanism is dead. Animals think, feel; so do machines now.
> Neither man nor woman is the measure of all things. Every organism
> processes data according to its domain, its environment; you, with
> all your brains, would be useless in a mouse's universe..."
> - Greg Bear, Slant
> -------------------------------------------------------------------
>
>
>
===========================================================================
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".