Original Post
Hi! I'm writing an application which generates a tree. Every node calculates its position, length and vector based on its parent node. And it is working. I simply initalize a line for every treenode and then draw it with directx. My problem with that: it is too static. I have a tree where every node based on the parent node, so if I transform the matrix of the parent I can get the child. So I made a STL stack wih D3DXMATRIX. The child reads with top(). Next is the transformation. But my tree simply falling apart, when I do this. When the drawing is based on absolute coordinates, there is no problem. What I'm doing: 1. read the matrix of the parent 2. translate that matrix with the length of the parent, so I'm at the endpoint. 3. rotate with the angle between the parent and the child 4. draw a line 5. push the matrix And then going to the grandchild. And repeat. However the angles are good the nodes are separeted with space, which size is growing with the depth of the tree. I really can't figure out what have I done wrong. I hope you can.