<div class="gmail_quote">On Wed, Jul 18, 2012 at 1:53 PM, Gonzalo Amadio <span dir="ltr"><<a href="mailto:gonzaloamadio@gmail.com" target="_blank">gonzaloamadio@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Well, here is my code, now it seems to work .<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
vtkSmartPointer<vtkCylinderSource> cylinderSource = vtkSmartPointer<vtkCylinderSource>::New();<br></div>
cylinderSource->SetCenter(center[0], center[1], center[2]);<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();<br>
</div>
transform->Translate(-center[0],-center[1],-center[2]);<br>transform->PostMultiply(); <font color="#ff0000">//This was the fundamental line, if I have not put this line, the second translation goes to a wrong place.</font><br>
transform->RotateX(90);<br>transform->Translate(centerV[0],centerV[1],centerV[2]);<br></blockquote><div class="im HOEnZb"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">vtkSmartPointer<vtkTransformPolyDataFilter> transF = vtkSmartPointer<vtkTransformPolyDataFilter>::New();<br>
transF->SetInput(cylinderSource->GetOutput());<br>transF->SetTransform(transform);<br>transF->Update();<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">vtkSmartPointer<vtkPolyData> cylinder = transF->GetOutput();</blockquote>
</div></blockquote><div><br></div><div>You may find Lecture 2: Transforms from here:</div><a href="http://www.vtk.org/Wiki/VTK/Presentations">http://www.vtk.org/Wiki/VTK/Presentations</a><br clear="all"><br>useful as well, but it seems you've already solved the problem.<br>
<br></div><div class="gmail_quote">David</div>