<div dir="ltr">You probably want something more like:<div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px"><div>vtkSphereSource *sSource= vtkSphereSource::New();</div><div> sSource->SetThetaResolution( 12);</div>
<div> sSource->SetPhiResolution ( 12);</div><div> sSource->SetCenter( 0, 0, 0 );</div><div> sSource->SetRadius( 10.0 );</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<div>vtkTransform* transform = vtkTransform::New();</div><div> transform->Identity();</div><div> transform->Scale(3,1,1);</div><div> transform->Update();</div><div style>vtkTransformPolyDataFilter* tFilter = vtkTransformPolyDataFilter::New();</div>
<div style>tFilter->SetInputConnection(sSource.GetOutputPort());</div><div style>tFilter->SetTransform(transform);</div><div style>tFilter->Update()</div><div style><br></div><div style><div>vtkPolyDataMapper *map = vtkPolyDataMapper::New(); </div>
<div>map->SetInputConnection(tFilter->GetOutputPort());</div><div><br></div><div>.................</div><div><br></div><div style>I didn't change your example much due to laziness and wanting to copy/paste, but you really should use vtkSmartPointers.</div>
<div><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 9, 2013 at 5:06 PM, mar x <span dir="ltr"><<a href="mailto:myint101@gmail.com" target="_blank">myint101@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear VTK list,<div><br></div><div>I want to create a 3D object that looks like an egg/ovoid. I tried to to this with vtkSphere and by setting the vtkTransform->Scale to something like 3,1,1 but it's not working. I would be very glad if you could help me on this. Please find below the code and thank you for any help!</div>
<div><br></div><div><div><br></div><div><div>vtkSphereSource *sSource= vtkSphereSource::New();</div><div> sSource->SetThetaResolution( 12);</div><div> sSource->SetPhiResolution ( 12);</div><div> sSource->SetCenter( 0, 0, 0 );</div>
<div> sSource->SetRadius( 10.0 );</div></div><div><br></div><div><div>vtkTransform* transform = vtkTransform::New();</div><div> transform->Identity();</div><div> transform->Scale(3,1,1);</div><div> transform->Update();</div>
<div> vtkSphere* sphere = vtkSphere::New();</div><div> sphere->SetCenter(0,0,0);</div><div><span style="white-space:pre-wrap"> </span>sphere->SetTransform(transform);</div></div><div><br></div><div> vtkSmartPointer<vtkClipPolyData> clipper = vtkSmartPointer<vtkClipPolyData>::New();</div>
<div> clipper->SetInputConnection(sSource->GetOutputPort());</div><div> clipper->SetClipFunction(sphere);</div><div> clipper->SetValue(0);</div><div> clipper->Update();</div><div><br></div><div>
vtkPolyDataMapper *map = vtkPolyDataMapper::New(); </div><div> map->SetInput(clipper->GetOutput());</div><div><br></div><div> vtkActor *aSphere = vtkActor::New(); </div><div> aSphere->SetMapper(map); </div>
<div>
aSphere->GetProperty()->SetColor(0,0,1); </div></div><div>......</div><div>.....</div><div>.....</div></div>
<br>_______________________________________________<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><br clear="all"><div><br></div>-- <br><div dir="ltr">Shawn Waldon<div>Graduate Student</div><div>Department of Computer Science</div><div>University of North Carolina at Chapel Hill</div><div><a href="mailto:swaldon@cs.unc.edu" target="_blank">swaldon@cs.unc.edu</a></div>
</div>
</div>