[vtkusers] Complete Initialization of vtkLODActor prior Interaction
tobse
tobias.meisel at phacon-leipzig.de
Mon Dec 8 05:21:41 EST 2008
Hi,
I like to present different LODactors in a scene. The simplified application
is shown below. This works fine, except on thing. In the case the desired
update rate (during interaction) can not be fulfilled, it switches to the
low-level resoltion, but the "switching" is too slowly (I assume for loading
the low level mapper - allocating memory). After same interactions it is as
fast as desired.
My preferred behaviour is: Load everything the might be needed prior
starting the renderer / interactor, so that interaction is always as fast as
possible, even in the beginning. it is not problem that the initalization
needs more time. What I tried so far is to -->Update() readers and mappers.
//Reader
vtkPLYReader* reader = vtkPLYReader::New();
vtkPLYReader* readerlow = vtkPLYReader::New();
//Mapper
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
mapper->SetInput(reader->GetOutput());
vtkPolyDataMapper* mapperlow = vtkPolyDataMapper::New();
mapperlow->SetInput(readerlow->GetOutput());
//Actor
vtkLODActor* lodactor = vtkLODActor::New();
lodactor->AddLODMapper(mapper);
lodactor->AddLODMapper(mapperlow);
//Renderer and Window
vtkRenderer* ren = vtkRenderer::New();
ren->AddActor(lodactor);
vtkRenderWindow* renwin = vtkRenderWindow::New();
renwin->AddRenderer(ren);
//Interactor
vtkRenderWindowInteractor * iren =
vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renwin);
iren->SetStillUpdateRate(0.1);
iren->SetDesiredUpdateRate(20);
renwin->Render(); // init renderer
iren->Initialize();
iren->Start();
// Delete everything
I prefer not to use vtkLODProp3D cause my Design bases a lot of vtkActor,
but this is not a must. ? I would be glad for any advice.
Tobias
--
View this message in context: http://www.nabble.com/Complete-Initialization-of-vtkLODActor-prior-Interaction-tp20892749p20892749.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list