From: "matthias sweertvaegher"
<[EMAIL PROTECTED]>
Sent: Wednesday, August 22, 2001 12:01 PM
> hello
>
> I believe I have discovered a bug in the Transform3D class
I think that it's less a bug in Transform3D and more an exposure
of excessive generosity in the constructors of the vecmath
library.
> the documentation says the following about
Transform3D.transform(Vector3f) :
> Transforms the point parameter with this transform and places
the result back into point. > The fourth element of the point
input paramter is assumed to be one.
Vecmath implements homogeneous coordinates in the usual way.
Points have the form (x, y, z, 1), and they transform to points.
Vectors have the form (x, y, z, 0), and they transform to
vectors. Trouble is that vecmath lets you construct vectors
with the form (x, y, z, 1) by virtue of their inheritance from
Tuple4f, and the results you get are difficult to interpret or
flat misleading.
> However when I pass a vector3f to the transform method , the
vector stays (0,0,0)
> My transform works, because when I transform a vector4f
initialised to (0,0,0,1) the vector is correctly transformed
> So I believe the transformmethod doesn't use a w-value=1
> Or am I interpreting the meaning of "....assumed to be one"
wrong?
>
> 1) transform of vector3f , pos stays (0,0,0)
> Vector3f pos = new Vector3f(); file://initialises pos
to (0,0,0)
> transform3d.transform(pos);
>
> 2) transform of vector4f , pos is correctly transformed
> Vector4f pos = new Vector4f(0,0,0,1);
> transform3d.transform(pos);
The operation you propose really isn't defined (because proper
Vector4fs have the form (x, y, z, 0)) even though vecmath lets
you do it.
HTH,
Fred Klingener
===========================================================================
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".