[vtkusers] Extracting the color components from 3DSimporter after appending

ODWBR ODWBR odwbrodwbr at gmail.com
Mon Apr 13 01:46:12 EDT 2009


Dear all,
I am trying to extract the color data from 3DS file after appending its
objects, then render each color in a separate renderwindow.
My code looks like the following:

vtk3DSImporter *importer = vtk3DSImporter::New();
importer->SetFileName('Sample.3ds');
importer->Read();
vtkAppendPolyData* append = vtkAppendPolyData::New();
for (vtk3DSMesh* mesh = importer->MeshList; mesh != (vtk3DSMesh *) NULL;
mesh = (vtk3DSMesh *) mesh->next)
{
     vtkPolyData* polyData = mesh->aPolyData;
     append->AddInput(polyData);
}
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
mapper->SetInputConnection(append->GetOutputPort());
vtkActor* actor = vtkActor::New();
actor->SetMapper(mapper);
vtkRenderer* Ren=vtkRenderer::New();
Ren->AddActor(actor);
vtkRenderWindow* renWin = vtkRenderWindow::New();
renWin->AddRenderer(Ren);
renWin->Render();

The problem is that the result image will be in gray, that means when
appending the polyData, I'm taking the geometry without the values of each
pixel.
So which filters should I use in case I need to display the Red data only of
the 3DS object???... How could I get color components after appending?
 Any idea to solve this problem would be appreciated ...
Thanks in advance...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090413/f71e3f93/attachment.htm>


More information about the vtkusers mailing list