<div dir="ltr">Or try:<div><div>// .NAME vtkParametricEllipsoid - Generate an ellipsoid.</div><div>// .SECTION Description</div><div>// vtkParametricEllipsoid generates an ellipsoid.</div><div>// If all the radii are the same, we have a sphere.</div>
<div>// An oblate spheroid occurs if RadiusX = RadiusY > RadiusZ.</div><div>// Here the Z-axis forms the symmetry axis. To a first</div><div>// approximation, this is the shape of the earth.</div><div>// A prolate spheroid occurs if RadiusX = RadiusY < RadiusZ.</div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 9, 2013 at 5:11 PM, Shawn Waldon <span dir="ltr"><<a href="mailto:swaldon@cs.unc.edu" target="_blank">swaldon@cs.unc.edu</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">You probably want something more like:<div><br></div><div><div class="im"><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>
<div style="font-family:arial,sans-serif;font-size:13px"><div class="im">
<div>vtkTransform* transform = vtkTransform::New();</div><div> transform->Identity();</div><div> transform->Scale(3,1,1);</div><div> transform->Update();</div></div><div>vtkTransformPolyDataFilter* tFilter = vtkTransformPolyDataFilter::New();</div>
<div>tFilter->SetInputConnection(sSource.GetOutputPort());</div><div>tFilter->SetTransform(transform);</div><div>tFilter->Update()</div><div><br></div><div><div class="im"><div>vtkPolyDataMapper *map = vtkPolyDataMapper::New(); </div>
</div><div>map->SetInputConnection(tFilter->GetOutputPort());</div><div><br></div><div>.................</div><div><br></div><div>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"><div><div class="h5">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>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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></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><span class="HOEnZb"><font color="#888888"><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>
</font></span></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>Unpaid intern in BillsBasement at noware dot com<br>
</div>