[vtkusers] polydata Update() problem
Ganesh Sankaranarayanan
ganeshs at uta.edu
Sun Apr 22 03:32:36 EDT 2001
Hi all,
I am trying to deform the vertices of a structured grid.I created the mesh
as follows
for (i=0; i<121; i++) points->InsertPoint(i,x[i]);
for (i=0; i<100; i++) polys->InsertNextCell(4,pts[i]);
for (i=0; i<121; i++) scalars->InsertScalar(i,i);
and giving all the three to a VTK polydata and then the output to a mapper
'meshmapper'.I am trying to update the meshmapper in a loop.I also have a
sphere object and i set the center of the sphere using the X,Y,Z
coordinate.
//Code fragment
while(1)
{
getcursor3D()//Not an vtk function ** returns XYZ coordinates of my
interface.
sphere->SetCenter(x,y,z);
sphere->Update();
deformation();//This function changes the array of points i used to create
the mesh x[121][3]
for (i=0; i<121; i++) points->InsertPoint(i,x[i]);
for (i=0; i<100; i++) polys->InsertNextCell(4,pts[i]);
for (i=0; i<121; i++) scalars->InsertScalar(i,i);
meshmapper->Update();
renWin->Render()
//infinite loop just for my simulation testing
}
When the program is executed i could get the sphere to update every time
when x,y,z changes but my mesh just updates only for the first time.I
couldn't update it afterwards.
Does anyone know why its so.How should i use Update() for polydata class.
Thanks in advance,
Ganesh
********************************************
Arise Awake and Stop not till the goal is
reached
********************************************
Ganesh Sankaranarayanan
Graduate Research Assistant
Virtual Environment lab
142,Nedderman Building
Yates Street Arlington TX 76010
Ph 817-272 5719
********************************************
Homepage http://www.geocities.com/sankaganesh
********************************************
More information about the vtkusers
mailing list