From: "Thomas Gilbert Giusepe" <[EMAIL PROTECTED]>
Sent: Tuesday, November 20, 2001 5:58 AM


> Hi there,
>
> I need to get the sum of coordinates from two vertex at the
same point3d.
> Something like that:
>
> Point3d sumP3D1=new Point3d(0.0,0.0,15.0);
> Point3d valueP3D2=new Point3d(0.0,0.0,20.0);
> // Sum two point3d:
> sumP3D1=sumP3D1+valueP3D2;
>
> So in order to have at the end the values (0.0,0.0,35.0) in my
sumP3D1 ?
> Some clue on how to perform it !? Thnx in advance!
> Best wishes. Thomas  ...�:0).

Thomas,

Point3d inherits a couple of add()s from Tuple3d, so you could
do it directly.  Just remember that Point3ds are homogeneous
coordinates that have the underlying form (x, y, z, 1) even
though Java3D exposes only the '3' part.  This means that adding
two of them gives a form like (x1+x2, y1+y2, z1+z2, 2).  You're
on your own interpreting what that means.  Unless you're on your
way to dividing element-wise by two to get a midpoint, you might
get funny results when you transform them.

Rethink what it is you're trying to do.  If you're just trying
to move a point, try adding a Point3d and a Vector3d, say.
This'll return a sensible Point3d.

Cheers,

Fred Klingener
Brock Engineering

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