<br><br>
<div class="gmail_quote">2009/4/2 Konstantinos Kelg <span dir="ltr"><<a href="mailto:kkelgeor@yahoo.gr">kkelgeor@yahoo.gr</a>></span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>Hello,<br><br><br>I need to set the normals of a surface.<br>I have 1 normal for each vertex of the mesh.<br>
I try this but I get a crash:<br><br><br>vtkFloatArray* arr = vtkFloatArray::New();<br>arr->SetNumberOfComponents(3);<br>arr->SetArray((float*)NormP, m_NumOfVertices, 0);<br>polyData->GetCellData()->SetNormals(arr);<br>
arr->Delete();<br><br><br>I found this piece of code on the web but it's not complete:<br><br>vtkPolyDataNormals *normals = vtkPolyDataNormals::New();<br>normals->SetInput(yourData); // Is "yourData" the normals per vertex ?</blockquote>
<div> ~~~~~~~yourData is the polydata whose vertex normal is to be calculated, and the ouput of the vtkPolyDataNormals is the polydata that contains the normals, you can check the instance of the vtkPointData or vtkCellData to retrieve the normals</div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><span></span><br>normals->ComputeCellNormalsOn();<br>normals->ComputePointNormalsOff();<br>normals->Update();<br>
<br>Does anyone know which is the way to do this and how do I actually set the vtkPolyDataNormals if I should follow the 2nd way ?<br><br>Thanks.<br><br><br><br><br><br>___________________________________________________________<br>
Χρησιμοποιείτε Yahoo!;<br>Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail<br>διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών<br>μηνυμάτων <a href="http://login.yahoo.com/config/mail?.intl=gr" target="_blank">http://login.yahoo.com/config/mail?.intl=gr</a><br>
<br><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>王君臣<br>