[vtkusers] vtkDecimatePro with 3DS file

Akhtar Shamim shamimz at gmail.com
Sun Apr 15 00:09:55 EDT 2007


Hi Everyone,

I just downloaded and installed VTK using Visual Studio .Net 2003. Didnt
have any pain in getting started. I compiled and installed the SDK. I also
wrote a few examples to let me have a feel of VTK.

Actually, my intention right now is to use the vtkDecimatePro for polygon
reduction of large terrain data (which is in 3DS file format). I know that
vtk has a 3DS importer. I can import the 3DS file and view it on the screen.
However, I have no clue on how to attach this 3DS file to the
vtkDecimatePro. I found examples where the vtkDecimatePro takes in an input
from the output of a vtkPolyDataReader as shown in the following code.

My problem is:
1. how to get the the vtkPolyData from the 3DS importer and set to the
vtkDecimatePro as input?
2. How to get all the triangles from the output of the reduced polygon and
save to a 3DS file?


>>
    vtkPolyDataReader* fran = vtkPolyDataReader::New();
    fran->SetFileName("E:/Try/VSolution/somedata.vtk");

    //vtk3DSImporter *fran = vtk3DSImporter::New();
    //fran->SetFileName("E:/Try/VSolution/VTKPolyReduction/knight.3ds");
    //fran->Read();

    //We want to preserve topology (not let any cracks form). This may
    //limit the total reduction possible, which we have specified at 90%.
    vtkDecimatePro* deci = vtkDecimatePro::New();
    deci->SetInputConnection(fran->GetOutputPort()); // how to set data
loaded by 3DS importer here?????
    deci->SetTargetReduction(0.9);
    deci->PreserveTopologyOn();
>>


Any help will be greatly appreciated.

Best regards,
Shamim Akhtar.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070415/1e68fd06/attachment.htm>


More information about the vtkusers mailing list