[vtkusers] How to display the normal information !

Darshan Pai darshanpai at gmail.com
Tue Nov 22 04:17:03 EST 2005


I think it should be GetTuple3 instead of GetTuple

On 11/21/05, Helena Kaldeira <h_kaldeira at hotmail.co.uk> wrote:
>
> hello everybody,
> I am trying to load a 3D model and calculate its normal so that I may
> print
> the values of its normals .I h ave got the following code which is derived
> from another thread of VTK partly found at
> http://public.kitware.com/pipermail/vtkusers/2004-September/076497.html
>
>
> *****************************************************************************
> #include "vtkPolyDataMapper.h"
> #include "vtkRenderWindow.h"
> #include "vtkCamera.h"
> #include "vtkActor.h"
> #include "vtkRenderer.h"
> #include "vtkXMLPolyDataReader.h"
> #include "vtkPolyDataNormals.h"
> #include "vtkPolyData.h"
> #include "vtkPointData.h"
>
>
> int main( int argc, char *argv[] )
> {
> vtkXMLPolyDataReader *reader1 = vtkXMLPolyDataReader::New();
> reader1->SetFileName("C:\\VtkProjects\\normal\\bunny_vtp_zipper.vtp");
>
> vtkPolyDataNormals *dataset = vtkPolyDataNormals::New();
> dataset->SetInput(reader1->GetOutput());
> dataset->SetFeatureAngle(60.0);
> dataset->FlipNormalsOff();
> dataset->Update();
>
> for (int pointID=0; pointID < dataset->GetOutput()->GetNumberOfPoints();
> pointID++)
> {
> float *point =
>
> (float*)(reader1->GetOutput()->GetPointData()->GetNormals()->GetTuple(pointID));
>
> printf("x -> %f",(float)point[0]);
> printf("y -> %f",(float)point[1]);
> printf("z -> %f",(float)point[2]);
>
>
> }
> }
> *********************************************************************
> I am new to mailing list,forwarding my mail to the ppl who contributed in
> the above mentioned discussion,please let me know if it is not allowed :)
> I m really desperate to get any hint whts wrong on with my code
>
> Thanks and Regards,
> Helena
>
> _________________________________________________________________
> MSN Messenger 7.5 is now out. Download it for FREE here.
> http://messenger.msn.co.uk
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051122/b9baa5b4/attachment.htm>


More information about the vtkusers mailing list