<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font face="Comic Sans MS">Dear All,</font><div><font face="Comic Sans MS"><br></font></div><div><font face="Comic Sans MS">I observe very weird problem with performance of VTK. </font><span style="font-family: 'Comic Sans MS'; font-size: 12pt;">I load the polydata with </span></div><div><font face="Comic Sans MS">vtkObjReader and populate it to produce 2K objects in the scene. Along with loading</font></div><div><font face="Comic Sans MS">phase of scene which is 10-15sec, rendering phase is also very slow and it doesn't even </font></div><div><font face="Comic Sans MS">interact with scene. </font></div><div><font face="Comic Sans MS"><br></font></div><div><font face="Comic Sans MS">I hardly believe but probably I configured something in a wrong way in VTK because I </font></div><div><font face="Comic Sans MS">originated the program by directly modifying ObjReader example in official VTK page.</font></div><div><font face="Comic Sans MS"><br></font></div><div><font face="Comic Sans MS">The *.obj file which I load can be found at the attachement.</font></div><div><font face="Comic Sans MS"><br></font></div><div><font face="Comic Sans MS">I'll appreciate your guidance,</font></div><div><font face="Comic Sans MS"><br></font></div><div><font face="Comic Sans MS"><div>int main(int argc, char *argv[])</div><div>{</div><div> // Parse command line arguments</div><div> /*if(argc != 2)</div><div> {</div><div> std::cout << "Usage: " << argv[0] << " Filename(.obj)" << std::endl;</div><div> return EXIT_FAILURE;</div><div> }</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>*/</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> vtkSmartPointer<vtkRenderer> renderer =</div><div> vtkSmartPointer<vtkRenderer>::New();</div><div> vtkSmartPointer<vtkRenderWindow> renderWindow =</div><div> vtkSmartPointer<vtkRenderWindow>::New();</div><div> renderWindow->AddRenderer(renderer);</div><div> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =</div><div> vtkSmartPointer<vtkRenderWindowInteractor>::New();</div><div> renderWindowInteractor->SetRenderWindow(renderWindow);</div><div><br></div><div>for (int i=0;i<2000;i++)</div><div>{</div><div> std::string filename = argv[1];</div><div> vtkSmartPointer<vtkOBJReader> reader =</div><div> vtkSmartPointer<vtkOBJReader>::New();</div><div> reader->SetFileName("........new_I_Profile.obj");// SetFileName(filename.c_str());</div><div> reader->Update();</div><div><br></div><div> // Visualize</div><div> vtkSmartPointer<vtkPolyDataMapper> mapper =</div><div> vtkSmartPointer<vtkPolyDataMapper>::New();</div><div> mapper->SetInputConnection(reader->GetOutputPort());</div><div><br></div><div> vtkSmartPointer<vtkActor> actor =</div><div> vtkSmartPointer<vtkActor>::New();</div><div> actor->SetMapper(mapper);</div><div> renderer->AddActor(actor);</div><div>}</div><div> </div><div> renderer->SetBackground(.3, .6, .3); // Background color green</div><div><br></div><div> renderWindow->Render();</div><div> renderWindowInteractor->Start();</div><div><br></div><div> return EXIT_SUCCESS;</div></font></div> </div></body>
</html>