<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&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"><<a href="mailto:MaxSchererMax@gmail.com" target="_blank">MaxSchererMax@gmail.com</a>></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'm<br>
wondering why I'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<vtkParametricEllipsoid> parametricVTKEllipsoid =<br>
vtkSmartPointer<vtkParametricEllipsoid>::New();<br>
vtkSmartPointer<vtkParametricFunctionSource> parametricFunctionSource =<br>
vtkSmartPointer<vtkParametricFunctionSource>::New();<br>
vtkSmartPointer<vtkMatrix4x4> transformationMatrix =<br>
vtkSmartPointer<vtkMatrix4x4>::New();<br>
vtkSmartPointer<vtkMatrixToLinearTransform> matrixToLinearTransform =<br>
vtkSmartPointer<vtkMatrixToLinearTransform>::New();<br>
vtkSmartPointer<vtkPolyDataMapper> mapper =<br>
vtkSmartPointer<vtkPolyDataMapper>::New();<br>
vtkSmartPointer<vtkLODActor> actor = vtkSmartPointer<vtkLODActor>::New();<br>
<br>
//Definition and transformation of the vtkEllipsoid<br>
parametricVTKEllipsoid->SetXRadius(radius[0]);<br>
parametricVTKEllipsoid->SetYRadius(radius[1]);<br>
parametricVTKEllipsoid->SetZRadius(radius[2]);<br>
parametricFunctionSource->SetParametricFunction(parametricVTKEllipsoid);<br>
parametricFunctionSource->Update();<br>
<br>
//Configuration of the rotation/translation<br>
configureMatrix(position, rotation, transformationMatrix);<br>
matrixToLinearTransform->SetInput(transformationMatrix);<br>
matrixToLinearTransform->Update();<br>
<br>
mapper->SetInput(parametricFunctionSource->GetOutput());<br>
actor->SetMapper(mapper);<br>
actor->SetUserTransform(matrixToLinearTransform);<br>
<br>
renderer_->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>