Hi Phelim,
you have to set the Quat-values to look in a different direction. The
Quaternion concept itself is somehow difficult to understand, but you can
take a look at the mailing list archive. So long, here is a some code I
wrote some time ago (positions and quats are Vectors), hope it helps, Marco.
protected void calcQuatsFromPositions()
{
Point3d eye = new Point3d();
Point3d center = new Point3d();
Vector3d up = new Vector3d(0.0, 1.0, 0.0);
Transform3D looky = new Transform3D();
Quat4f quat = new Quat4f();
for(int i = 0, j = 1; j < positions.size(); ++i, ++j) {
eye.set(((Point3f) positions.elementAt(i)).x, ((Point3f)
positions.elementAt(i)).y, ((Point3f) positions.elementAt(i)).z);
center.set(((Point3f) positions.elementAt(j)).x, ((Point3f)
positions.elementAt(j)).y, ((Point3f) positions.elementAt(j)).z);
looky.lookAt(eye, center, up);
looky.invert();
looky.get(quat);
quats.addElement(new Quat4f(quat));
}
quats.addElement(new Quat4f(quat));
}
----- Original Message -----
From: PK <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 01, 2000 12:56 PM
Subject: [JAVA3D] Where Camera points
> Hi,
> I succesfully got the camera to move around a scene, using
> RotPosScaleTCBSplinePathInterpolator. There's one small problem
however.
> The camera moves around OK, but it allways points in the negative z
> direction, i.e. - straight into the screen. What I want to do is the
> following, as the camera moves from one point to another, it's view
> points towards the next point, instead of straight ahead all the time.
> Can anyone help me with this? I hope I've explained myself properly!
>
> Thanks,
>
> Regards,
>
> Phelim.
>
>
===========================================================================
> 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".