Boost PC performance: How more available memory can improve productivity
Vtk point cloud important
1. Wiki3DVision Forum
General Category => 3D Reconstruction => Topic started by:
dashan on July 19, 2010, 05:25:15 PM
Title: How I display 3D model using imported point cloud
data with VTK
Post by: dashan on July 19, 2010, 05:25:15 PM
Step 1:
vtkRenderWindow *renWin = vtkRenderWindow::New();
vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
Step 2: Input Point Cloud
FILE *stream;
if( (stream = fopen( "c:pointcloud.txt", "r" )) == NULL )
{
printf( "The file 'data.txt' was not openedn" );
// return;
}
fscanf(stream,"%d", &num);
for(int i=0;i<num;i++){
//fscanf(stream,"%f %f %f %d %d %d", &tmpdata[0],
&tmpdata[1],&tmpdata[2], &tmpcol[0], &tmpcol[1],
&tmpcol[2]);//with color
fscanf(stream,"%f %f %f", &tmpdata[0],
&tmpdata[1],&tmpdata[2]);//without color
mypoint_1[0]=tmpdata[0];