<font size="2"><font face="verdana,sans-serif">Well, as I said, I don&#39;t have experience in manipulating hierarchical scene graph. I know how it should be done on an abstract level, but I never had to do it. I would be stabbing in the dark just the same as you are doing it :)<br>

</font></font><br><div class="gmail_quote">2011/8/24 Kacper Pluta <span dir="ltr">&lt;<a href="mailto:kacper.pluta@gmail.com">kacper.pluta@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi, I Used the vtkAssembly hierarchy and i have one new problem. When I turn the tree so that new root was in the upright position. It seems to me that the coordinates of the new roots are not current after tree rotation.<br>



<br>Part of my code below. And screenshot <span lang="en"><span>as an attachment.</span></span><br><br>  root = Tree-&gt;GetParts()-&gt;GetLastProp3D();<br>  double *orientation = root-&gt;GetOrientation();<br>

  Tree-&gt;SetOrientation(0,0,-*(orientation+2)); //left root n the upright position<br><br><br>  LeftBranchActor-&gt;SetPosition(*(root-&gt;GetXRange()+1)+LeftBranch-&gt;GetRadius(),*(root-&gt;GetYRange())-LeftBranch-&gt;GetHeight()/2,0);<br>



    <br>  LeftBranchActor-&gt;RotateZ(angle);<br>    <br>  RightBranchActor-&gt;SetPosition(*(root-&gt;GetXRange())-RightBranch-&gt;GetRadius(),*(root-&gt;GetYRange())-RightBranch-&gt;GetHeight()/2,0);<br>    <br>  RightBranchActor-&gt;RotateZ(angle);<br>



<br>  Tree-&gt;AddPart(RightBranchActor);<br>  Tree-&gt;AddPart(LeftBranchActor);<br>  //Tree-&gt;SetOrientation(0,0,0);<br>  <br>  GenTree(Tree-&gt;GetParts()-&gt;GetLastProp3D(),--rate,radius*pow(r,1/n));<br><br>By the way thanks for your replies.<div>

<div></div><div class="h5"><br>

<br><br><div class="gmail_quote">2011/8/24 Dženan Zukić <span dir="ltr">&lt;<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<font size="2"><font face="verdana,sans-serif"><span style="font-family:Geneva, Arial, Helvetica, sans-serif;font-size:16px;background-color:rgb(250, 250, 250)"><a href="http://www.vtk.org/doc/release/5.0/html/a01919.html#z4208_1" style="color:rgb(37, 46, 120);text-decoration:none;font-weight:bold" target="_blank">GetMatrix</a> or GetUserMatrix I guess. Try it and/or read documentation. I never used assemblies until a few days ago, and that was just for grouping.</span><br>






</font></font><div><div></div><div><br><div class="gmail_quote">2011/8/24 Kacper Pluta <span dir="ltr">&lt;<a href="mailto:kacper.pluta@gmail.com" target="_blank">kacper.pluta@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






How do I get to a particular matrix of element in the vtkAssembly hierarchy?<div><div></div><div><br><br><div class="gmail_quote">2011/8/24 Dženan Zukić <span dir="ltr">&lt;<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>&gt;</span><br>








<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2"><font face="verdana,sans-serif">Why don&#39;t you use a straightforward tree hierarchy of vtkAssemblies, each one having its own transformation matrix, nested under its parent&#39;s transformation matrix? That way you only need to worry about a branches transformation at its parents joint, and the hierarchy does the rest of the job for you?<br>










</font></font><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">I have not read this, but you may check this out:</font></div><div>

<a href="http://www.maplesoft.com/applications/view.aspx?SID=6850&amp;view=html" target="_blank">http://www.maplesoft.com/applications/view.aspx?SID=6850&amp;view=html</a></div><div><br></div><div>Also you can try searching &quot;scene graph hierarchy tutorial&quot;.</div>








<div><div></div><div>

<div><font face="verdana, sans-serif"><br></font><div class="gmail_quote">2011/8/24 Kacper Pluta <span dir="ltr">&lt;<a href="mailto:kacper.pluta@gmail.com" target="_blank">kacper.pluta@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span lang="en"><span>Now I see</span> <span>my mistake</span><span>.</span> <span>I am using the</span> <span>coordinates</span> <span>of the root</span><span>, and this</span> <span>is</span> <span>yet</span> <span>another</span> <span>place than the</span> <span>family,</span> <span>which</span> <span>is</span> <span>a part</span><span>.</span> <span>Except that</span> <span>this knowledge</span> <span>did not give</span> <span>me</span> <span>any</span> <span>more</span> <span>answers</span> <span>...</span></span><div>










<div></div><div><br>

<br><div class="gmail_quote">2011/8/24 Kacper Pluta <span dir="ltr">&lt;<a href="mailto:kacper.pluta@gmail.com" target="_blank">kacper.pluta@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">












I know but it&#39;s not a solution. I want to build <span lang="en"><span>3d</span> <span>tree</span> <span>of</span> <span>cylinders</span></span>, <span lang="en"><span>and I have</span> <span>a problem with</span> <span>inserting</span> <span>new branches</span> <span>at a right</span> <span>angle.</span></span> <span lang="en"><span>It is very easy</span> <span>when the</span> <span>root</span> <span>is in the</span> <span>upright position.</span></span> <span lang="en"><span>I tried</span> <span>to do</span> <span>this using</span> <span>vtkAssembly</span><span>.</span></span><span lang="en"><span>The whole procedure</span> <span>is described in</span> <span>the following</span> <span>pseudo</span><span>code. </span></span><span lang="en"><span>I have a problem</span> <span>with an appropriate</span> <span>setting for</span> <span>the family,</span> <span>after the restoration of</span> <span>the root to</span> <span>its</span> <span>original position. <br>














</span></span><span lang="en"><span>I thought</span> <span>it</span> <span>would be easier</span> <span>to add</span> <span>new branches</span> <span>without touching</span> <span>the root.</span> <span>I</span> <span>just</span> <span>manipulating</span> <span>the world</span> <span>coordinate system</span><span>.</span></span><br>













<br>Attached a part of the tree, which i want to get.<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;<div>













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></div><div><div></div><div>
<span lang="en"><span><br><br></span></span><br><br><br><div class="gmail_quote">2011/8/24 Dženan Zukić <span dir="ltr">&lt;<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2"><font face="verdana,sans-serif">If you don&#39;t want to manipulate the camera, you can put the whole scene into an vtkAssembly and then apply transformation to it.<br>














</font></font><br><div class="gmail_quote"><div><div></div><div>

On Tue, Aug 23, 2011 at 20:03, Kacper Pluta <span dir="ltr">&lt;<a href="mailto:kacper.pluta@gmail.com" target="_blank">kacper.pluta@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">














<div><div></div><div>

Hi!<br><br><span lang="en"><span>How do I</span> <span>rotate the</span> <span>whole scene</span><span>?</span></span><span lang="en"><span></span> <span>But</span> <span>I do not mean</span> <span>the</span> <span>camera.</span></span><br clear="all">
















<font color="#888888">

<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>
</font><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
</blockquote></div><br><br clear="all"><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>
</div></div></blockquote></div><br><br clear="all"><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>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><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>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><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>
</div></div></blockquote></div><br>