At the beginning I would like to welcome you all!<br><br>Some time ago, precisely some days ago I started to learn VTK and I encountered a problem with rotation.  I wanna write a recursive function to generate a tree in 3D. I generated a part of a tree, so you could see what I mean.<br>


<br>Below is a pseudocode. So you can see from my point of view, and you may be able to correct it.<br><br>I have a big problem with the setup of new children at a right angle at the end of their root, after the restoration of the root angle, and angle of the family to which it belongs.<br>


<br><br>NODE GenTree(NODE root, int bifurcation)<br>{<br>  if(bifurcation &gt; 0 &amp;&amp; root != NULL)<br>  {  <br> <br>   Restart the angle of Parent root famili if exist;<br>  //(root is part of the family, e.g. the left child of his Parent)<br>


<br>    Restart the root angle;<br><br>    //Now root agnel is set to 90 degrees<br>    <br>    //make new bifurcation<br>    Create the children;<br>    Set children position to lower ends of root;<br>    Set children origin to center of root;<br>


    rotate the children on Z axis;<br>   <br>    restore root angle;<br>    restore Parent of root famili angle;<br><br>   //Make root famili<br>   root-&gt;Famili = vtkAssembly::New();<br>   root-&gt;Famili-&gt;AddPart(root-&gt;Left-&gt;BranchActor);<br>


   root-&gt;Famili-&gt;AddPart(root-&gt;Right-&gt;BranchActor);<br><br>    Set Famili origin??<br>    rootate the root famili?<br>   //<span lang="en"><span>Now the</span> <span>family</span> <span>is at the end</span> <span>of the root.</span></span><br>


<br>    root-&gt;Left-&gt;Left = GenTree(root-&gt;Left,--bifurcation);<br>   //root-&gt;Left-&gt;Right = GenTree(root-&gt;Right,--bifurcation);<br>  }<br>}<br clear="all"><br><br>/**********************/<br>OS: OpenSUSE 11.4 x86_64<br>


VTK VERSION: 5.6.1<br>cmake: 2.8.3<br>Language: C++<br>/**********************/<br><br>-- <br>&quot;If you build your empire on money, it&#39;ll fall like a house of cards, if you build it on love, you&#39;ve built Taj Mahal!&quot; - Mark Hartmaier<br>


<br>