Modifying the polyData points/vertices in VTK
<p>I'm trying to use VTK to change points, i.e. I am changing coordinates (x,y,z) by a (+1/-1) value. I am reading an .OBJ file and then accessing the points of a model and when I am trying to visualise the changes in the model the RenderWindow doesnt show anything. Below is my code:-</p>

<pre><code>vtkSmartPointer&lt;vtkOBJReader&gt; reader = vtkSmartPointer&lt;vtkOBJReader&gt;::New();
reader-&gt;SetFileName(filename.c_str());
reader-&gt;Update();

vtkSmartPointer&lt;vtkPolyData&gt; polyData = reader-&gt;GetOutput();
polyData-&gt;Update();

Point3d point;
std::vector&lt;Point3d&gt; vertices; 

double p[3];        
vtkPoints* points = vtkPoints::New();       
vtkDoubleArray* pcoord = vtkDoubleArray::New();

pcoord-&gt;SetNumberOfComponents(3);       
pcoord-&gt;SetNumberOfTuples(polyData-&gt;GetNumberOfPoints());

for(vtkIdType i = 0; i &lt; polyData-&gt;GetNumberOfPoints(); i++) 
{  
    polyData-&gt;GetPoint(i,p);
    p[0] +=1;
    p[1] +=1;
    p[2] +=1;
    pcoord-&gt;SetTuple(i, p);       
}

points-&gt;SetData(pcoord);
polyData-&gt;SetPoints(points);   
polyData-&gt;Modified();

//Visualize Code

vtkSmartPointer&lt;vtkPolyDataMapper&gt; mapper = vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();
mapper-&gt;SetInputConnection(reader-&gt;GetOutputPort());

vtkSmartPointer&lt;vtkActor&gt; actor = vtkSmartPointer&lt;vtkActor&gt;::New();
actor-&gt;SetMapper(mapper);

vtkSmartPointer&lt;vtkRenderer&gt; renderer = vtkSmartPointer&lt;vtkRenderer&gt;::New();
renderer-&gt;AddActor(actor);

vtkRenderWindow* renderWindow = vtkRenderWindow::New();
renderWindow-&gt;AddRenderer(renderer);

vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; renderWindowInteractor = vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();
renderWindowInteractor-&gt;SetRenderWindow(renderWindow);

renderWindowInteractor-&gt;Initialize();
renderWindowInteractor-&gt;Start();
</code></pre>

<p>I am new to this 3D and VTK stuff, Please check where I am missing since I want to change the coordinates of each vertex (x,y,z). Do I need to further change something else as well?</p>

<p>Many Thanks.</p>