----- Original Message -----
From: "Fred Klingener" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 09, 2002 3:13 PM
Subject: Re: [JAVA3D] Rotations


> > >1. Points are P1 and P2
> > >2. length of cylinder L = |P2 - P1|
> > >3. desired unit vector along axis of cylinder V = (P2 - P1)/L
> > >4. midpoint of line M = (P1 + P2)/2> > . . .
> > >5. Construct cylinder Shape3D cyl = new Shape3D . . .
> > >    I forget what axis the Java 3D primitive Cylinder lines up on, say
> it's the
> > >    X-axis, X.
> > > . . .
> > >7. Find rotation axis   S = X cross V;  // don't normalize it here.
>
> Transform3D t3d = new Transform3D(new Quat4d(S.x, S.y, S.z, X dot V), new
> Vector3d(M), 1.0);

This is, of course, wrong.  Yet another argument for an immediate 'undo' on
the email 'send' button.  *sigh*

Required form of the quat is (n*sin(theta/2), cos(theta/2)), so we probably
have to work through

sin(theta/2) = ((1 - (X dot V))/2)^1/2
cos(theta/2)= ((1 + (X dot V))/2)^1/2

Now, I think I'll shut up at least until I can see whether this actually
works and whether it really doesn't have worse quadrant problems than
arccos.

Cheers,
Fred

===========================================================================
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