[vtkusers] vtkOBJReader
Veerapuram Varadhan
v.varadhan at californiadigital.com
Tue Mar 9 09:19:44 EST 2004
The following piece of sample can get you required tuple from the polydata.
vtkPolyData* input = NULL;
int nPoints = 0;
float intensity_value = 0.00;
float* coord = NULL;
input = vtkOBJReader->GetOutput();
nPoints = input->GetNumberOfPoints;
for (int i = 0; i < nPoints; i++)
{
// to get the co-ordinate corresponding to a point in polydata
coord = input->GetPoint(i);
// to get the intensity value corresponding to a point in polydata
intensity_value = input->GetPointData()->GetScalars()->GetTuple1(i);
}
Hope this helps,
V. Varadhan.
> On Mar 9, 2004, at 3:08 AM, Bernhard wrote:
>
>> I use the vtkOBJReader, i tried the example, but i don´t know, how i
>> can access the points, tuples and cells in this output. How can i do
>> this?
>
> vtkOBJReader's output is vtkPolyData. Once the file has been read into
> the pipeline, you can access the vtkPolyData returned from
> vtkOBJReader->GetOutput(). I usually run it through vtkPolyDataNormals
> and vtkStripper before accessing the data.
>
> Hope this helps,
> Chris
>
> --
> Chris Scharver
> Electronic Visualization Laboratory
> The University of Illinois at Chicago
> Ph: 312-996-3002 FAX: 312-413-7585
> <http://www.evl.uic.edu/scharver/>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list