[vtkusers] Slow Performance with 2K actors (*.obj file)
Sonya Blade
sonyablade2010 at hotmail.com
Sun Jun 15 01:32:34 EDT 2014
Dear All,
I observe very weird problem with performance of VTK. I load the polydata with vtkObjReader and populate it to produce 2K objects in the scene. Along with loadingphase of scene which is 10-15sec, rendering phase is also very slow and it doesn't even interact with scene.
I hardly believe but probably I configured something in a wrong way in VTK because I originated the program by directly modifying ObjReader example in official VTK page.
The *.obj file which I load can be found at the attachement.
I'll appreciate your guidance,
int main(int argc, char *argv[]){ // Parse command line arguments /*if(argc != 2) { std::cout << "Usage: " << argv[0] << " Filename(.obj)" << std::endl; return EXIT_FAILURE; } */ vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New(); vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New(); renderWindowInteractor->SetRenderWindow(renderWindow);
for (int i=0;i<2000;i++){ std::string filename = argv[1]; vtkSmartPointer<vtkOBJReader> reader = vtkSmartPointer<vtkOBJReader>::New(); reader->SetFileName("........new_I_Profile.obj");// SetFileName(filename.c_str()); reader->Update();
// Visualize vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New(); mapper->SetInputConnection(reader->GetOutputPort());
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New(); actor->SetMapper(mapper); renderer->AddActor(actor);} renderer->SetBackground(.3, .6, .3); // Background color green
renderWindow->Render(); renderWindowInteractor->Start();
return EXIT_SUCCESS;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140615/0b4eb48a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Objects.obj
Type: application/octet-stream
Size: 1617 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140615/0b4eb48a/attachment.obj>
More information about the vtkusers
mailing list