Transform point using localToSceneTransform
pavel.safrata at oracle.com
Mon Jul 23 07:51:26 PDT 2012
On 23.7.2012 16:30, Pedro Duque Vieira wrote:
> Thanks for the info Pavel, I'll be using the internal method for now than.
> I thought I would try to help out and post some other suggestions for the
> transform class. I have read this discussion but not with the necessary
> attention so apologies if I mention something that has already been
> discussed, or bring up discussion topics that have already reached a
> 1- public Vector3D transform(Vector3D point)
> This implies having a Vector class which I think is appropriate. Vector
> objects may be used to represent translation, surface normals, pick rays,
> or other things
Is the existing Point3D not sufficient?
> 2- I don't like the append, prepend naming for the following reason: are
> you adding or subtracting or multiplying,.. matrixs? I suggest "multiply"
> as the name of the method.
We are appending the transformation ("transforming" the matrix). It is
more natural for transforms to be concatenated/appended than multiplied
because you may generally use them without being aware of their matrix
> 3- public double determinant()
> Calculates and returns the determinant of this transform
Is part of the proposal.
> 4- public boolean equals(Transform t)
I think we should not provide equals/hashCode for mutable objects.
> 5- invert()
> Inverts this transform in place
Is part of the proposal.
> 6- multiply(double scalar)
> Multiplies each element of this transform by a scalar.
> 7- subtract(Transform t)
> substracts this matrix with matrix t
> 8- add(Transform t)
> adds this matrix with matrix t
> 9- transpose()
> Transposes this matrix
Are those methods useful for some transformation stuff? This is not a
MatrixMath class, this is Transform...
> Thanks, best regards,
>> currently there is no API for this. It is planned for the 3.0 release
>> (together with other matrix algebra operations - thanks for reminding me
>> by the way). So right now you unfortunately need to do the math yourself.
>> P.S. I didn't tell you this but as a temporary workaround you can use an
>> undocumented internal (but publicly accessible) method
>> impl_transform(Point3D). Please note that this method will be removed in
>> the next version (with the addition of the proper public methods).
>> On 21.7.2012 0:02, Pedro Duque Vieira wrote:
>>> I need to transform a point using the localToSceneTransform of a node,
>>> however I don't see any method on Transform class to accomplish this.
>>> Is there an easy way or do I have to do the math myself?
>>> Thanks, best regards,
More information about the openjfx-dev