If you have only a list of frames (bones/nodes) with parent indices to start with, and you want to build a DX9-like hierarchy, you can do something like:
1. create a D3DXFRAME* (or equivalent) for the root frame, setting its children and siblings to NULL.
2. go through your list, looking for parent index = root index.
3. when a child of root is found, create a D3DXFRAME* for the child, setting newFrame->pFrameFirstChild and newFrame->pFrameSibling to NULL.
4. if root frame's pFrameFirstChild is NULL, set pFrameFirstChild to the child frame pointer.
5. if root frame's pFrameFirstChild isn't NULL, check pFrameFirstChild->pFrameSibling.
6. if pFrameSibling is NULL, set pFrameSibling to the child frame pointer.
7. if pFrameSibling isn't NULL, check pFrameSibling->pFrameSibling. (goto step 6)
Once you've searched the list for the root frame's index (as a parent), use the same steps to search for root->pFrameFirstChild's index as a parent, then pFrameFirstChild->pFrameSibling, etc. To ensure you've gotten everyone, you can remove a child from the list after you've created a frame for it and added that frame as a child or sibling. If you've done it all correctly, the original list should be empty (if it's a true hierarchy to begin with).
Edited by Buckeye, 06 July 2014 - 03:48 PM.