Trouble getting absolute vector from a Transform3D
I am having difficulty getting a true translation vector from a transform.
BranchGroup bg1 = new BranchGroup();
BranchGroup bg11 = new BranchGroup();
TransformGroup tg1 = new TransformGroup();
TransformGroup tg11 = new TransformGroup();
Transform3D trans1 = new Transform3D();
Transform3D trans11 = new Transform3D();
Vector3f v1 = new Vector3f(0.0f, 1.0f, 0.0f);
v1.set(0.0f, -1.0f, 0.0f);
So far so good. I omit any geometry because I don't believe it really matters. Here is where I get an issue...
BranchGroup bg2 = new BranchGroup();
TransformGroup tg2 = new TransformGroup();
Transform3D trans2 = new Transform3D();
tg2.addChild(bg1); // attaching previous BranchGroup to this TransformGroup
// Now let's try to get that translation out
Transform3D t3d = new Transform3D();
Vector3f v = new Vector3f();
That will output: (0.0, 1.0, 0.0)
Strictly speaking, that isn't what I'm looking for. The object that I attach to tg1 will have swapped places with the object attached to tg11. Of course, it will rotated 180degrees from it's starting axis.
What I want is to be able to get the new vector on it's location (in this case, I was looking for an output of: (0.0, -1.0, 0.0)
Is that possible? Thanks in advance for any help.
(I apologize if any of the code is off, this is not the actual code I'm working on. The actual code is a little too obfuscated to easily show what I'm looking for. This is merely an example of what I'm trying for.)