Cumulative transform between two nodes?
Cumulative transform between two nodes?
Is there a utility function to calculate the cumulative transform between two arbitrary nodes in a scene graph in JReality?
Re: Cumulative transform between two nodes?
You can create a SceneGraphPath for each of nodes, both paths starting at the scene root. Then use path1.getMatrix and path2.getInverseMatrix and multiply them together. There is no utility function for this, because the paths might not be unique.
Re: Cumulative transform between two nodes?
I just ran across these two methods that retrieve the path, given a node or a name.
When used with getMatrix for the path, these should be sufficient for cleanly getting the transforms necessary to render cylinders between two nodes, which is why I'm interested in it.
Thanks
_-T
Code: Select all
static List<SceneGraphPath> SceneGraphUtility.getPathsBetween(SceneGraphComponent begin, SceneGraphNode end)
static List<SceneGraphPath> SceneGraphUtility.getPathsToNamedNodes(SceneGraphComponent root, String name)
Thanks
_-T
Re: Cumulative transform between two nodes?
All right, I forgot about that method. It will return all paths from one component to a node, in your case it is probably just one path. Still you need two paths, except if one component is an ancestor of the other.