Hello,
im trying to display a point cloud and the axis/ground/various static data.
I can create my points and axis without any issue. My problem is that the lines that represent the axis are always in front, even if the point is supposed to be in front of the axis
In the picture, its the same scene, one from the top, one from the bottom, and the axis are akways in front of the points.
mRenderers[Renderers::Background] = vtkSmartPointer<vtkRenderer>::New();
mRenderers[Renderers::Points] = vtkSmartPointer<vtkRenderer>::New();
mRenderers[Renderers::StaticData] = vtkSmartPointer<vtkRenderer>::New();
mRenderers[Renderers::ForeGroundInfo] = vtkSmartPointer<vtkRenderer>::New();
mRenderers[Renderers::Background]->SetLayer( 0 );
mRenderers[Renderers::Points]->SetLayer( 1 );
mRenderers[Renderers::StaticData]->SetLayer( 1 );
mRenderers[Renderers::ForeGroundInfo]->SetLayer( 2 );
mVTKWidget->renderWindow()->SetNumberOfLayers( 3 );
for( const auto &lRenderer : mRenderers )
{
mVTKWidget->renderWindow()->AddRenderer( lRenderer.second );
}
mRenderers[Renderers::Points]->SetActiveCamera( mRenderers[Renderers::Background]->GetActiveCamera() );
mRenderers[Renderers::StaticData]->SetActiveCamera( mRenderers[Renderers::Background]->GetActiveCamera() );
mRenderers[Renderers::ForeGroundInfo]->SetActiveCamera( mRenderers[Renderers::Background]->GetActiveCamera() );
This is how I created my renderers and set layers.
Is it possible to have the two renderers that are on the same layer respect depth and position?
Note: if I put them in the same renderer, it’s working correctly
Note2: I would prefer to keep them in two renderers, because data in the “StaticData” almost never change, but data in the “Points” renderer change all the time.
Maybe im misunderstanding the concept of renderers
Thanks