Vladimir,
Here is some code I use to set the viewpoint.

private void setviewtransform()
    {
     //viewpoint,targetTG are globals
     //targetTG contains reference to the VIEW transform
     //of this universe.



      eyeX=ViewPosition.x;  //new position x from a variable in  class
ViewPosition
      eyeY=ViewPosition.y; //new position  y
      eyeZ=ViewPosition.z; //new position  z

      LookatX=ViewPosition.x1; //new look at position x
      LookatY=ViewPosition.y1; //new look at position y
      LookatZ=ViewPosition.z1; //new look at position z


      eyeLocation.set(eyeX, eyeY, eyeZ);
      lookingAt.set(LookatX, LookatY,LookatZ);
      up.set(0.0d, 1.0d, 0.0d);

      viewpoint.lookAt(eyeLocation, lookingAt, up);
      viewpoint.invert();
      targetTG.setTransform(viewpoint);
    }

The up vector specfies the viewer orientation wrt the point
looked at.ie whether the viewer is standing on his/her
head or not.The head angle is specfied indirectly
by using the lookat point.By changing the look at point
you can change the angle of the head.If you move the look at point
around the position (in a circle) then you simulate turning the head in a
horizontal
plane, similarily if you move the lookat point around the position in an
imaginary vertical
circle,then you are simulating nodding.

Also you need to invert before you set the viewpoint.
I dont know exactly the reason behind this but
for my application it seems not to be a problem.

Daryle.
-----Original Message-----
From: Vladimir Olenin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, July 23, 1999 6:54 AM
Subject: [JAVA3D] Transform3D.lookAt() general question


>Does anybody here knows how this funciton actually works? In General
>Documentation it is said:
>
>> lookAt
>>
>> public void lookAt(Point3d eye,
>>                    Point3d center,
>>                    Vector3d up)
>>
>>     Helping function that specifies the position and orientation of a
view matrix.
>>     Parameters:
>>         eye - the location of the eye
>>         center - a point in the virtual world where the eye is looking
>>         up - an up vector specifying the frustum's up direction
>
>I wonder why we need "center" parameter, since it's sufficient to have
>only eye's position in the virtual world and vector pointing out the
>direction of the look. Moreover, in most cases (at least in my case) i
>don't actually know _the point_ the eye should look at, but rather
>direction only. Have i misunderstood something or what? I think the
>answer is as simple as a keyboard, but.... Please, if anybody knows the
>answer, help me.
>
>vladimir
>--
>             -=V=-
>>~~~~~~~<=============>~~~~~~~<
>Join in Java community now!
>http://javacafe.virtualave.net/
>>~~~~~~~<=============>~~~~~~~<
>
>===========================================================================
>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