[vtkusers] Improving rendering speed
Ajit Rajwadé
ajit_v_r at hotmail.com
Sat Jun 14 09:38:04 EDT 2003
Hello,
I need some tips for improving rendering speed. I am rendering a 3D surface
(from 8000 points) and it takes 15 seconds for the Render routine. Is this
merely a hardware problem?
Here is what I am doing:
(ren is the vtkRenderer and renWin is the vtkRenderWindow - the call
"renWin->Render" takes ages. I am using the triangle strips as well, as
somebody had suggested. I have another model which consists of 76000 points
and the whole thing takes 4 minutes to render. I am fully optimizing my
code.)
// Create a data set. Load the starting points
vtkPolyData *inputDataSet = vtkPolyData::New();
inputDataSet->SetPoints(meanPoints);
// Construct the surface
vtkSurfaceReconstructionFilter *surf =
vtkSurfaceReconstructionFilter::New();
surf->SetInput(inputDataSet);
// Create isosurface
vtkContourFilter *cf = vtkContourFilter::New();
cf->SetInput(surf->GetOutput());
cf->SetValue(0,0.0);
cout << "Isosurface construction done..." << endl;
vtkPolyDataNormals *bNormals = vtkPolyDataNormals::New();
bNormals->SetInput(cf ->GetOutput());
bNormals->SetFeatureAngle(60.0);
vtkStripper *bStripper = vtkStripper::New();
bStripper->SetInput(bNormals->GetOutput());
vtkPolyDataMapper *map = vtkPolyDataMapper::New();
map->SetInput(bStripper->GetOutput());
map->ScalarVisibilityOff();
vtkActor *surfaceActor = vtkActor::New();
surfaceActor->SetMapper( map );
ren->AddActor(surfaceActor);
ren->SetBackground(1,1,1);
printf ("\nBefore the Rendering");
renWin->Render();
printf ("\nRendering done...");
_________________________________________________________________
MSN Messenger : discutez en direct avec vos amis !
http://www.msn.fr/msger/default.asp
More information about the vtkusers
mailing list