<div dir="ltr">Hi,<div><br></div><div>I'm able to show a set of points in screen that have a face form, now, how can I add the skin to it? I only see a lot of points..</div><div><br></div><div>This is my code:</div><div>
<br></div><div><div> vtkTesting test = vtkTesting.New();</div><div> string root = test.GetDataRoot();</div><div> string filePath = System.IO.Path.Combine(root, @"C:/tracker/mesh.poi");</div>
<div> FileStream fs = null;</div><div> StreamReader sr = null;</div><div> String sLineBuffer;</div><div> String[] sXYZ;</div><div> char[] chDelimiter = new char[] {';'};</div>
<div> double[] xyz = new double[3];</div><div> vtkPoints points = vtkPoints.New();</div><div> int cnt = 0;</div><div><br></div><div> fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);<br>
</div><div> sr = new StreamReader(fs);</div><div> while (!sr.EndOfStream)</div><div> {</div><div> sLineBuffer = sr.ReadLine();</div><div> cnt++;</div><div> sXYZ = sLineBuffer.Split(chDelimiter, StringSplitOptions.RemoveEmptyEntries);</div>
<div> if (sXYZ == null)</div><div> {</div><div> System.Windows.MessageBox.Show("data seems to be in wrong format at line " + cnt, "Format Exception");</div>
<div> return;</div><div> }</div><div> xyz[0] = double.Parse(sXYZ[0], CultureInfo.InvariantCulture);</div><div> xyz[1] = double.Parse(sXYZ[1], CultureInfo.InvariantCulture);</div>
<div> xyz[2] = double.Parse(sXYZ[2], CultureInfo.InvariantCulture);</div><div> points.InsertNextPoint(xyz[0], xyz[1], xyz[2]);</div><div> }</div><div> vtkPolyData polydata = vtkPolyData.New();</div>
<div> polydata.SetPoints(points);</div><div><br></div><div> vtkSurfaceReconstructionFilter surf = new vtkSurfaceReconstructionFilter();</div><div> surf.SetInput(polydata);</div><div> vtkContourFilter cf = new vtkContourFilter();</div>
<div> cf.SetInputConnection(surf.GetOutputPort());</div><div><br></div><div> vtkVertexGlyphFilter glyphFilter = vtkVertexGlyphFilter.New();<br></div><div> glyphFilter.SetInputConnection(polydata.GetProducerPort());</div>
<div> glyphFilter.Update();</div><div><br></div><div> // Visualize</div><div> vtkPolyDataMapper registracion_mapper = vtkPolyDataMapper.New();</div><div><br></div><div> registracion_mapper.SetInputConnection(glyphFilter.GetOutputPort());<br>
</div><div> vtkActor actorregistracion = vtkActor.New();</div><div> actorregistracion.SetMapper(registracion_mapper);</div><div> actorregistracion.GetProperty().SetPointSize(3);</div><div>
actorregistracion.GetProperty().SetColor(1, 0.5, 0);</div></div></div>