<P>
Hello Everybody,<BR>
Iam using vtk42 and vc++7.<BR>
Iam trying to resize a polygon at runtime.<BR>
I created a polygon made of triangle strips.<BR>
The coordinate points are in a vtkdoublearray and then Iam storing the values in vtkpoints.<BR>
Then the vtkcellarray hold the cell values, and Iam using vtkpolydata to hold the points and the cells.<BR>
Iam using vtkpolydatamapper to map the data and then a vtkactor.<BR>
In a while loop after rendering for sometime (iam not using interactor), I change the coordinates of the <BR>
polygon in the vtkdoublearray.Then I update the mapper.<BR>
BUT the polygon is not resized, I dont know why. Can someone please tell me why its not happening and correct it please.<BR>
<BR>
Thank you,<BR>
David Michell<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
void main( )<BR>
{<BR>
<BR>
vtkOpenGLRenderer *rn=vtkOpenGLRenderer::New(); <BR>
vtkWin32RenderWindowInteractor *ract;<BR>
<BR>
vtkWin32OpenGLRenderWindow *win=vtkWin32OpenGLRenderWindow::New();<BR>
win->AddRenderer(rn);<BR>
<BR>
vtkPropAssembly *m_assembly;<BR>
m_assembly=vtkPropAssembly::New();<BR>
<BR>
tkDoubleArray *m_coordinates;<BR>
vtkPoints *m_points;<BR>
vtkCellArray *m_cells;<BR>
vtkPolyData *m_polys;<BR>
vtkPolyDataMapper *m_polyMapper;<BR>
vtkActor *m_polyActor;<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
m_coordinates =vtkDoubleArray::New();<BR>
m_coordinates->SetNumberOfComponents(3);<BR>
m_coordinates->SetNumberOfTuples(4);<BR>
<BR>
<BR>
m_coordinates->SetTuple3(0,0.0,0.0,0.0); <BR>
m_coordinates->SetTuple3(1,0.0,5.0,0.0);<BR>
<BR>
m_coordinates->SetTuple3(2,5.0,0.0,0.0);<BR>
m_coordinates->SetTuple3(3,5.0,5.0,0.0);<BR>
<BR>
m_points =vtkPoints::New();<BR>
m_points->SetNumberOfPoints(4);<BR>
m_points->SetData(m_coordinates );<BR>
<BR>
<BR>
<BR>
<BR>
m_cells =vtkCellArray::New();<BR>
m_cells->InsertNextCell(4);<BR>
m_cells->InsertCellPoint(0);<BR>
m_cells->InsertCellPoint(2);<BR>
m_cells->InsertCellPoint(3);<BR>
m_cells->InsertCellPoint(1);<BR>
<BR>
<BR>
m_polys =vtkPolyData::New();<BR>
m_polys->SetPoints(m_points );<BR>
m_polys->SetPolys(m_cells);<BR>
<BR>
m_polyMapper =vtkPolyDataMapper::New();<BR>
m_polyMapper->SetInput(m_polys );<BR>
<BR>
<BR>
<BR>
m_polyActor =vtkActor::New();<BR>
m_polyActor->SetMapper(m_polyMapper );<BR>
m_polyActor->GetProperty()->SetColor(0.0,1.0,0.0);<BR>
m_polyActor->GetProperty()->SetOpacity(0.25);<BR>
<BR>
m_assembly->AddPart(m_polyActor);<BR>
rn->AddActor(m_assembly);<BR>
<BR>
<BR>
unsigned long x;<BR>
<BR>
while (true)<BR>
{<BR>
for (x=0;x<300;x++);<BR>
win->Render();<BR>
<BR>
//here iam changing the coordiantes <BR>
m_coordinates->SetTuple3(0,0.0,0.0,0.0); <BR>
m_coordinates->SetTuple3(1,0.0,5.0,0.0); <BR>
m_coordinates->SetTuple3(2,8.0,0.0,0.0);<BR>
m_coordinates->SetTuple3(3,8.0,5.0,0.0);<BR>
<BR>
m_polyMapper->Update();<BR>
<BR>
}<BR>
<BR>
<BR>
}<BR>
<BR>
</P>
<br><br>
<A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp"><IMG SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom" BORDER=0 VSPACE=0 HSPACE=0 HEIGHT=74 WIDTH=496></a>