Hello everyone (again!),

OK, so I solved my own problem!  The getClosestsVertexCoordinatesVW() method
returns the absolute coordinates - calculating even the effects of a
MouseRotation.  Since I was not considering this and applying only the
inverse of the local coordinate system transform, the effects were not
cancelling.

Confused?  Sorry about that.  Just never mind my question.

Thanks and have a great day,

Chris

-----Original Message-----
From: Christopher Collins [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 24, 2000 12:15 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Virtual World to Local Coordinates


Hi everyone,

I'm currently working with a system that contains multiple coordinate
systems, organized through transform groups.  Each transform group has a
PointArray under it.  There is also a "global" point array whose transform
is identity.  What I want to do is take a "global" point - one defined under
a transform group with the identity transform, and add that point to a
"local" system - one with a transform defining a rotation and translation.
The catch is that I don't want the point to move in the virtual world - I
want to convert the coordinates so that it can be "copied" to the local
system, but in the scene it looks like there is no change.

I tried to do this by getting the transform defining the local system,
inverting it, applying it to the global point, then adding the new point to
the local system.  I thought the application of the inverted transform,
followed by the application of the original transform would cancel, but it
doesn't and the point appears out of place.  Perhaps there is an element of
matrix multiplication that I am forgetting.

This is a pseudocode of what I tried:

        clickPt = (pi.getClosestVertexCoordinatesVW());  // where pi is a
PickIntersection and getClosestVertexCoordinatesVW() returns the "global"
coordinates of that point

        Transform3D tempTransform = new Transform3D(localSystem.t3D); // get
the transform which defines the destination local system

        tempTransform.invert();  // invert this transform
            tempTransform.transform(clickPt); // apply it to the point

        localSystem.addPoint(clickPt); //add the point -> t3D will be
applied to it and cancel the application of tempTransform to result in no
overall change in position


Please let me know if you have any suggestions on how to do this!


Chris
__________________________________________________
Christopher Collins             http://www.ucs.mun.ca/~a62cmc
Oceanic Consulting Corporation          (709) 754-2357 [home]
Memorial University of Newfoundland      (709) 749-4383 [cell]

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

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