<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:10pt"><div>Hi,<br><br>I'm currently trying to get some vtkDataSets from 3DS files. From some similar posts on the mailing list some suggest on getting the data from the renderer itself.<br>So far what i've done loading it to the renderer but i'm still not able to get the data via GetMapper(). I'm just wondering if i missed something =P<br><br>It compiles ok but the program crashes when executed. Using VC++ Express 2008 on windows xp<br><br>Below is a sample code:<br><br>vtk3DSImporter *importer = vtk3DSImporter::New();<br> importer->ComputeNormalsOn();<br> importer->SetFileName("C:/vtk3ds_test/bunny.3DS");<br> importer->Read();<br><br> vtkRenderWindow* renWin = (importer->GetRenderWindow());<br>
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br> iren->SetRenderWindow(renWin);<br><br> renWin->SetSize(300, 300);<br><br> vtkRenderer* ren = (importer->GetRenderer());<br> ren->SetBackground(0.1, 0.2, 0.4);<br><br> vtkActorCollection *acol = vtkActorCollection::New();<br> acol = ren->GetActors();<br><br> vtkActor *actor = vtkActor::New();<br> actor = acol->GetLastActor();<br> cout << "actor:" << actor->GetClassName() << endl;<br> <br> vtkOpenGLActor *oglActor = vtkOpenGLActor::New();<br> oglActor = (vtkOpenGLActor*)acol->GetLastActor();<br> cout << "oglActor: " << oglActor->GetClassName();<br> <br>
oglActor->GetMapper(); (ERROR ON THIS LINE)</div></div><br>
</body></html>