[vtkusers] vtkPolyData and SetPoints
Pan Ross
rosspan2004 at yahoo.com.cn
Tue Jun 28 01:10:16 EDT 2005
I want to display a point clouds and write the following codes:
vtkPoints * points = vtkPoints::New();
float x,y,z;
while( !feof(file) )
{
fscanf(file,"%f\t%f\t%f\n",&x, &y, &z);
points->InsertNextPoint(x,y,z);
}
fclose(file);
vtkPolyData * polydata = vtkPolyData::New();
polydata->SetPoints(points);
vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
mapper->SetInput(polydata);
vtkActor *actor = vtkActor::New();
actor->SetMapper(mapper);
this->Props->AddItem(actor);
But there is nothing in the window. Who can tell I why I cannot get the result.
Thanks
__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050628/87584966/attachment.htm>
More information about the vtkusers
mailing list