<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 &gt; 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 &lt; 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">&lt;<a href="mailto:swaldon@cs.unc.edu" target="_blank">swaldon@cs.unc.edu</a>&gt;</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-&gt;SetThetaResolution( 12);</div>
<div>   sSource-&gt;SetPhiResolution (  12);</div><div>   sSource-&gt;SetCenter( 0, 0, 0 );</div><div>   sSource-&gt;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-&gt;Identity();</div><div>   transform-&gt;Scale(3,1,1);</div><div>   transform-&gt;Update();</div></div><div>vtkTransformPolyDataFilter* tFilter = vtkTransformPolyDataFilter::New();</div>

<div>tFilter-&gt;SetInputConnection(sSource.GetOutputPort());</div><div>tFilter-&gt;SetTransform(transform);</div><div>tFilter-&gt;Update()</div><div><br></div><div><div class="im"><div>vtkPolyDataMapper *map = vtkPolyDataMapper::New(); </div>

</div><div>map-&gt;SetInputConnection(tFilter-&gt;GetOutputPort());</div><div><br></div><div>.................</div><div><br></div><div>I didn&#39;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">&lt;<a href="mailto:myint101@gmail.com" target="_blank">myint101@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 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-&gt;Scale to something like 3,1,1 but it&#39;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-&gt;SetThetaResolution( 12);</div><div>   sSource-&gt;SetPhiResolution (  12);</div><div>   sSource-&gt;SetCenter( 0, 0, 0 );</div>


<div>   sSource-&gt;SetRadius( 10.0 );</div></div><div><br></div><div><div>vtkTransform* transform = vtkTransform::New();</div><div>     transform-&gt;Identity();</div><div>   transform-&gt;Scale(3,1,1);</div><div>   transform-&gt;Update();</div>


<div>   vtkSphere* sphere = vtkSphere::New();</div><div>   sphere-&gt;SetCenter(0,0,0);</div><div><span style="white-space:pre-wrap">  </span>sphere-&gt;SetTransform(transform);</div></div><div><br></div><div>     vtkSmartPointer&lt;vtkClipPolyData&gt; clipper = vtkSmartPointer&lt;vtkClipPolyData&gt;::New();</div>


<div>    clipper-&gt;SetInputConnection(sSource-&gt;GetOutputPort());</div><div>    clipper-&gt;SetClipFunction(sphere);</div><div>    clipper-&gt;SetValue(0);</div><div>    clipper-&gt;Update();</div><div><br></div><div>


  vtkPolyDataMapper *map = vtkPolyDataMapper::New(); </div><div>  map-&gt;SetInput(clipper-&gt;GetOutput());</div><div><br></div><div>  vtkActor *aSphere = vtkActor::New(); </div><div>  aSphere-&gt;SetMapper(map); </div>

<div>
  aSphere-&gt;GetProperty()-&gt;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>