[vtkusers] 3DImporter - Does it help to extract polygon or volumetric data?

Hala ALBakour haloul02 at yahoo.co.uk
Thu Dec 13 05:43:55 EST 2007


Dear all,

I am very new to 3D modelling and vtk, I am using the
3DSImporter class to import and render a 3DS file,
which is working really fine, what I really need is
not only rendering, I need to read the file polygon
data and convert to it to vtkImageData, is there is
any way we can do this with the help of 3DSImporter,
the 3DSImporter class contains an interesting method
GeneratePolyData but it is protected and cannot be
used,

I know that vtk supports surface rendering (polygon
data), I think what vtk has imported and
rendered here is the polygon data of 3DS file? right?
my piece of code which imports a 3DS file is the
following:

vtkRenderer *ren = vtkRenderer::New();
ren->SetBackground(0.1, 0.2, 0.4);
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(ren);
renWin->SetSize(1024,768);
vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);

vtk3DSImporter *importer = vtk3DSImporter::New();
importer->SetRenderWindow(renWin);
importer->SetFileName("sample.3ds");
importer->ComputeNormalsOn();
importer->Read();

Is it possible to covert what has been generated in
the renderWindow into vtkImageData, I am pretty sure
there should be a way to manipulate 3DS surface data
after importing it, but probably I am not looking in
the right direction, 

Any suggestions and directions from you are really
appreciated,

Best regards,

Hala



      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com




More information about the vtkusers mailing list