Transform point using localToSceneTransform
Richard Bair
richard.bair at oracle.com
Wed Jul 25 08:54:30 PDT 2012
Haha, you're going to make me read the thread :-)
Generally speaking I'd prefer to just use Point3D vs. adding a Vector, primarily because we already made this decision several releases ago. Without having to read the whole thread, can you give a short summary of the impact using Point3D has vs. a class named Vector3D?
Richard
On Jul 25, 2012, at 6:54 AM, Pavel Safrata wrote:
> I think that if we define Vector*D as the class that represents magnitudes without position, and we use it for our magnitudes without position, we don't need any deltaTransforms, do we?
>
> Richard, what do you think about introducing Vector2D and Vector3D? I think the classes would be nice (to distinguish between specific points in space and magnitudes without position) but we would have to deprecate methods in Rotate that use Point3D as rotation axis and introduce different ones that use Vector3D, we would also need to deprecate the static axes defined in this class and define vector ones with different names..
>
> Thanks,
> Pavel
>
> On 25.7.2012 1:34, Pedro Duque Vieira wrote:
>> Hi Jim,
>>
>> Maybe we're talking about two different ways of performing the same
>> calculations, probably we come from different backgrounds.
>>
>> What I meant with Vector3d is a 4x1 matrix with the last element as 0
>> (homogeneous coordinates). We can then have methods on the Vector3d class
>> to give us things we expect to retrieve from vectors: like angle,
>> magnitude, doing the cross product of two vectors, calculating the angle
>> between two vectors.
>> As a reference one can look at the java3d implementation of Vector3d:
>> http://docs.oracle.com/cd/E17802_01/j2se/javase/technologies/desktop/java3d/forDevelopers/J3D_1_3_API/j3dapi/javax/media/j3d/Transform3D.html
>>
>>
>> Thanks, best regards,
>>
>> On Wed, Jul 25, 2012 at 12:06 AM, Jim Graham <james.graham at oracle.com>wrote:
>>
>>> Hi Pedro,
>>>
>>> delta transform is transform without translation. It is primarily used to
>>> transform magnitudes that have no position so you only modify them with the
>>> scale, shear, and rotation aspects of the matrix (i.e. everything but the
>>> translate components).
>>>
>>> For some reason I got the impression that Vector was only used to
>>> represent magnitude because people were bringing up delta transforms in the
>>> context of talking about it. If it is a 1x4 vector then it is just
>>> Point3D+perspective-w-element, [x,y,z,w] no? Point3D can participate in
>>> 4x4 transforms, supplying an implicit w=1 component, though it can't store
>>> the resulting w component if the matrix doesn't have 0,0,0,1 for the last 4
>>> elements (i.e. in perspective camera matrices)...
>>>
>>> ...jim
>>>
>>>
>>> On 7/24/2012 3:55 PM, Pedro Duque Vieira wrote:
>>>
>>>> Hi,
>>>>
>>>>
>>>> I've already commented on this in the matrix algebra thread, but I
>>>>> wanted to throw into this discussion the following point:
>>>>> I'm neutral on whether or not we need Vector - I'll leave that to the
>>>>> people with extensive 3D experience to comment. But, if transformation
>>>>> of vectors makes better sense to do a delta transform, and if we are
>>>>> adding deltaTransform() methods for other types (which I think we should
>>>>> do), then I think the "transform" method that does a "delta transform"
>>>>> on a Vector should actually be named "deltaTransform" for consistency,
>>>>> even if it is obvious that a vector should only be transformed that
>>>>> way...
>>>>>
>>>>>
>>>> I don't know what a delta transform is (never used it on my 3d work
>>>> background), so I cannot comment on that part.
>>>> All I can say is that I did use transform a vector by a given matrix
>>>> transform and it makes sense. It's basically a multiplication of a 4x4
>>>> matrix transform with a 1x4 matrix, just like what happens when you
>>>> transform a point3d.
>>>> So I think:
>>>> - void transform(Vector3d)
>>>> Should be present on the transform3d class.
>>>>
>>>> Just my 2 cents,
>>>>
>>>>
>>
>
>
More information about the openjfx-dev
mailing list