[vtkusers] How to visualize thousands of actors with good performance
Darshan Pai
darshanpai at gmail.com
Thu Sep 30 16:14:48 EDT 2010
On Thu, Sep 30, 2010 at 4:14 PM, Darshan Pai <darshanpai at gmail.com> wrote:
> Had a decent performance with 64-bit python on vtk 5.6.1 . maybe a 2 second
> delay . a little jerky . Did not try with 4.4 yet .
>
>
> On Thu, Sep 30, 2010 at 3:35 PM, Pascal Augustin <
> pascal at rogue-research.com> wrote:
>
>> >
>> > Good idea. Unfortunately I am not familiar with tcl as we use vtk in c++
>> only. If you could share the results with me/us, that would be great.
>> >
>>
>> Hi,
>>
>> As you've previously mentioned, rendering 10000s of actors was much
>> faster in vtk 4.4. Using the following Python script, I've obtained these
>> results:
>>
>> VTK 4.4.2: Rotating 10000 spheres takes about 30 seconds.
>>
>> VTK 5.0.4: Rotating 10000 spheres takes about 2 minutes. What is
>> interesting is that for the first few seconds, it is actually faster than in
>> 4.4.2. Then, it suddenly stalls for about 20 seconds. Afterwards, it
>> continues rotating slowly but at a regular pace.
>>
>>
>>
>> #------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> #!/usr/bin/env python
>> #
>>
>> import vtk
>>
>> ren = vtk.vtkRenderer()
>> append = vtk.vtkAppendPolyData()
>> for j in range(1, 100):
>> for i in range(1, 100):
>> sphere = vtk.vtkSphereSource()
>> sphere.SetRadius(1.0)
>> sphere.SetCenter(2 * i, 2 * j, 0)
>> sphere.SetThetaResolution(16)
>> sphere.SetPhiResolution(16)
>> sphereMapper = vtk.vtkPolyDataMapper()
>> sphereMapper.SetInput(sphere.GetOutput())
>> sphereActor = vtk.vtkActor()
>> sphereActor.SetMapper(sphereMapper)
>> ren.AddActor(sphereActor)
>>
>> renWin = vtk.vtkRenderWindow()
>> renWin.AddRenderer(ren)
>> renWin.SetSize(500, 500)
>>
>> for i in range(0, 15):
>> renWin.Render()
>> ren.GetActiveCamera().Roll(24)
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100930/52751885/attachment.htm>
More information about the vtkusers
mailing list