[vtkusers] Rendering multiple actors show the latest in the front and the rest hidden behind

Gomez, Alberto alberto.gomez at kcl.ac.uk
Wed Mar 10 13:29:29 EST 2010


Hi all,

I am trying to render several vtkVolumes, using a raycastmapper, adding 
them to the same renderer,  but the one I added the latest is masking 
the rest, even if it shouldn't.  The volumes contain transparencies. I 
have seen similar problems reported in the following threads:

http://article.gmane.org/gmane.comp.lib.vtk.user/19221/match=culler
http://article.gmane.org/gmane.comp.lib.vtk.user/25115/match=culler
http://article.gmane.org/gmane.comp.lib.vtk.user/20133/match=culler

And I have tried three different approaches:

1)
((vtkFrustumCoverageCuller*)  
ren->GetCullers()->GetLastItem())->SetSortingStyleToBackToFront();

2)
vtkFrustumCoverageCuller *culler =
        (vtkFrustumCoverageCuller*)(ren->GetCullers()->GetItemAsObject(0));
        culler->SetSortingStyleToBackToFront();

and 3)

vtkCuller *culler;

    for (ren->GetCullers()->InitTraversal(); (culler =
    ren->GetCullers()->GetNextItem()); ) {

    if (culler->IsA("vtkFrustumCoverageCuller")) {

    ((vtkFrustumCoverageCuller*)culler)->SetSortingStyleToBackToFront();

    }

    }



None of them work for me. I add this lines just before  doing 
iren->Render();
    iren->Start();

What I am doing wrong?

Thanks in advance,

Alberto

-- 

Alberto Gómez

/Division of Imaging Sciences
The Rayne Institute
4th Floor, Lambeth Wing
St Thomas' Hospital
London SE1 7EH /

phone: +44 (0) 20 718 88364
email: alberto.gomez at kcl.ac.uk <mailto:alberto.gomez at kcl.ac.uk>




More information about the vtkusers mailing list