Hi !
I haven't tried this, so it might not work ...
> And what I want to do is, create a standard "arrow" inside a transform
> group and translate it to the midpoint of A and B, and rotate it such
> that it "points" at B.
// create the transform group to place the arrow in
TransformGroup arrowTransform = new TransformGroup();
arrowTransform.addChild(arrow);
Transform3D t3d = new Transform3D();
// origin of arrow : (a + b) / 2
Point3D origin = new Point3D(A);
origin.add(B);
origin.mul(0.5);
// direction the arrow points to is (b - a)
Vector3D direction = new Vector3D(b);
direction.sub(a);
// lets assume the direction of the arrow is parallel to the x-axis
Vector3D normalDirection = new Vector3D(1.0, 0.0, 0.0);
// calculate the turning-angle, perhaps this has to be negated !?!
double angle = direction.angle(normalDirection);
// turning axis is the normale of direction and normalDirection
Vector3D axis = new Vector3D();
axis.cross(direction, normalDirection);
// set values in transformgroup;
t3d.setRotation(new AxisAngle4d(axis, angle));
t3d.setTranslation(new Vector3D(origin));
arrowTransform.setTransfrom(transform);
Hope this helps (and works ;) ...
Niklas
===========================================================================
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".