<div dir="ltr">vtkGlyph3D will be more efficient. vtkGlyph3DMapper will be still more efficient.<div><div style><br></div><div style>The concept you want is to define a single data set with points at the locations where you want the elipsoids and the rotation matrices encoded into a vector field on those locations, then apply either glypher to place and orient a single ellipsoid instance onto that data set.</div>

</div><div style><br></div></div><div class="gmail_extra"><br clear="all"><div>David E DeMarle<br>Kitware, Inc.<br>R&amp;D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div>
<br><br><div class="gmail_quote">On Wed, May 22, 2013 at 8:56 AM, VoodooCode <span dir="ltr">&lt;<a href="mailto:MaxSchererMax@gmail.com" target="_blank">MaxSchererMax@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
<br>
I want to draw half a million ellipsoids, all defined by their radii, a<br>
rotation matrix and a translation. Unfortunetly my code is way to slow to do<br>
this. It takes way to much GPU and graphic card memory. Drawing 16k<br>
ellipsoids is the maximum if I draw them in a loop using the provided sample<br>
code.<br>
<br>
I have read that there are people drawing about a million objects so I&#39;m<br>
wondering why I&#39;m that slow when drawing only half a million simple<br>
ellipsoids.<br>
<br>
In oder to give you some background information:<br>
 I want to draw 500k Ellipsoids<br>
 Rotation matrix(already combined, single matrices are not available) per<br>
ellipsoid<br>
 Translation vector per ellipsoid.<br>
 Set of radii per ellipsoid.<br>
<br>
This is my code sample. There is a loop using this code to draw all the<br>
ellipsoids, but for some reason it is terribly slow:<br>
<br>
//Start of sample<br>
<br>
vtkSmartPointer&lt;vtkParametricEllipsoid&gt; parametricVTKEllipsoid =<br>
vtkSmartPointer&lt;vtkParametricEllipsoid&gt;::New();<br>
        vtkSmartPointer&lt;vtkParametricFunctionSource&gt; parametricFunctionSource =<br>
vtkSmartPointer&lt;vtkParametricFunctionSource&gt;::New();<br>
        vtkSmartPointer&lt;vtkMatrix4x4&gt; transformationMatrix =<br>
vtkSmartPointer&lt;vtkMatrix4x4&gt;::New();<br>
        vtkSmartPointer&lt;vtkMatrixToLinearTransform&gt; matrixToLinearTransform =<br>
vtkSmartPointer&lt;vtkMatrixToLinearTransform&gt;::New();<br>
        vtkSmartPointer&lt;vtkPolyDataMapper&gt; mapper =<br>
vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
        vtkSmartPointer&lt;vtkLODActor&gt; actor = vtkSmartPointer&lt;vtkLODActor&gt;::New();<br>
<br>
        //Definition and transformation of the vtkEllipsoid<br>
        parametricVTKEllipsoid-&gt;SetXRadius(radius[0]);<br>
        parametricVTKEllipsoid-&gt;SetYRadius(radius[1]);<br>
        parametricVTKEllipsoid-&gt;SetZRadius(radius[2]);<br>
        parametricFunctionSource-&gt;SetParametricFunction(parametricVTKEllipsoid);<br>
        parametricFunctionSource-&gt;Update();<br>
<br>
        //Configuration of the rotation/translation<br>
        configureMatrix(position, rotation, transformationMatrix);<br>
        matrixToLinearTransform-&gt;SetInput(transformationMatrix);<br>
        matrixToLinearTransform-&gt;Update();<br>
<br>
        mapper-&gt;SetInput(parametricFunctionSource-&gt;GetOutput());<br>
        actor-&gt;SetMapper(mapper);<br>
        actor-&gt;SetUserTransform(matrixToLinearTransform);<br>
<br>
        renderer_-&gt;AddActor(actor);<br>
<br>
//End of sample<br>
<br>
Regards,<br>
VoodooCode<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Drawing-half-a-million-vtkParametricEllipsoid-s-tp5720865.html" target="_blank">http://vtk.1045678.n5.nabble.com/Drawing-half-a-million-vtkParametricEllipsoid-s-tp5720865.html</a><br>


Sent from the VTK - Users mailing list archive at Nabble.com.<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>
</blockquote></div><br></div>