Hi,
Is it possible for a cascade of TransformGroups?
I mean, in my case, I've got a
which has a corresponding
1
| TransformGroup sphereTrans |
However, this sphereTrans belongs to a BranchGroup
1
| m_BranchGroup.addChild(sphereTrans); |
Further, this BranchGroup has a corresponding TransformGroup, say
1
| m_TransformGroup.addChild(m_BranchGroup); |
Now, I transform(including, rotation, scaling and translating) the top-level TransformGroup, say "m_TransformGroup".
This m_TransformGroup doesn't affect sphereTrans at all. But, sphere has been still transformed !!
This is correct !!!
However, how can I obtain the coordinate of this sphere now?
It looks like the total transform of this sphere replies on both TransformGroups "m_TransformGroup" and "sphereTrans".
So, what are the exact code that I can use to obtain the coordinate (3D and 2D on screen projection) of "sphere"?
Urgent... Please do help.
Thanks in advance.
Best Regards
JIA
1) correct the coordinates in the geometry is defined in local space. They are transformed into eye space when rendered using the TransformGroups. You can use the the getLocalToVWorld method to get a transform you can use to transform the coordinates into world space, if that is what you are after.
2) There might be something you can use in com.sun.j3d.utils.universe.ViewInfo. Why do you need this information?