[Insight-users] vtkDataSets from 3DS files

Luis Ibanez luis.ibanez at kitware.com
Tue May 13 15:37:54 EDT 2008


Hi Justin,

The problem that you describe doesn't seem to be related to ITK.

You may want to send this question to the VTK users list.
You will find a lot more of VTK expertise in that list.


    Regards,


       Luis


----------------------
justin goyanko wrote:
> Hi,
> 
> 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.
> 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
> 
> It compiles ok but the program crashes when executed. Using VC++ Express 
> 2008 on windows xp
> 
> Below is a sample code:
> 
> vtk3DSImporter *importer = vtk3DSImporter::New();
>     importer->ComputeNormalsOn();
>     importer->SetFileName("C:/vtk3ds_test/bunny.3DS");
>     importer->Read();
> 
>     vtkRenderWindow* renWin = (importer->GetRenderWindow());
>     vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>     iren->SetRenderWindow(renWin);
> 
>     renWin->SetSize(300, 300);
> 
>     vtkRenderer* ren = (importer->GetRenderer());
>     ren->SetBackground(0.1, 0.2, 0.4);
> 
>     vtkActorCollection *acol = vtkActorCollection::New();
>     acol = ren->GetActors();
> 
>     vtkActor *actor = vtkActor::New();
>     actor = acol->GetLastActor();
>     cout << "actor:" << actor->GetClassName() << endl;
>    
>     vtkOpenGLActor *oglActor = vtkOpenGLActor::New();
>     oglActor = (vtkOpenGLActor*)acol->GetLastActor();
>     cout << "oglActor: " << oglActor->GetClassName();
>    
>      oglActor->GetMapper();          (ERROR ON THIS LINE)
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list