[vtkusers] a specific normal of a point

tony hakki tony2007vtk at yahoo.com
Mon Jan 8 04:41:48 EST 2007


Hi !

I am having some problems calculating a specific normal of a point on the surface of an object. I found an example through the internet, but at this example vtkNormals  is used which is not in the vtk library(Also compiler says there is no  such fileor directory). But that code seems what I would exactly want to do. Here is the code ,please suggest me how to rearrange  code.

stlreader=vtkSTLReader::New();
  mapper=vtkPolyDataMapper::New();
  pNormals= vtkPolyDataNormals::New();
  motorActor=vtkActor::New();
  vtkNormals *norm=vtkNormals::New();

  stlreader->SetFileName("brol.stl");
  pNormals->SetInput(stlreader->GetOutput());
  mapper->SetInput(pNormals->GetOutput());
  motorActor->SetMapper(mapper);
  motorActor->SetProperty(brolProps);

  this->Props->AddItem(motorActor);

  int pointID;
  vtkDataSet *data;
  data=motorActor->GetMapper()->GetInput();
  pointID=data->FindPoint(78.9994, 73.6264, 197.831);

 float *normal;
 normal=norm->GetNormal(pointID);

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070108/7ef54f58/attachment.htm>


More information about the vtkusers mailing list