[vtkusers] Update on mising 2d and 3d actors

Anja Ende anja.ende at googlemail.com
Thu Oct 12 05:45:13 EDT 2006


Hi everyone,

Ok, I have almost tried everything unsuccessfully...exxcept for what would
make this thing work! I have had no success in mixing 2d and 3d actors.

So, my latest brilliant idea was to use multiple renderers and layer them on
the render window.

So, only the top one would have the 3d actors and the bottom one would be my
2d actor.... I thought this would work for sure!

Well, my code is like this:

this->m_actor2D->SetMapper(this->m_imageMapper);
this->m_renderer->AddViewProp(this->m_actor2D);
// first renderer
this->m_renderer->SetLayer(0);

vtkPNGReader * cursorImage = vtkPNGReader::New();
cursorImage->SetFileName("/home/anja/crosshair.png");
cursorImage->Update();

vtkImageChangeInformation * imageChange = vtkImageChangeInformation::New();
imageChange->SetInput(cursorImage->GetOutput());

vtkImageActor * actor = vtkImageActor::New();
actor->SetInput(imageChange->GetOutput());
imageChange->CenterImageOn();
// second renderer
this->m_renderer2->AddViewProp(actor);
this->m_renderer2->SetLayer(1);

// 2 layers
this->m_renderWindow->SetNumberOfLayers(2);
// Add the layers to my render window.
this->m_renderWindow->AddRenderer(this->m_renderer);
this->m_renderWindow->AddRenderer(this->m_renderer2);

Well, no matter what layer I put the 2d actor in... all I can see is the 3d
actor..always! I would die to see my 2d actor right now!!

Please help me here. I am totally out of ideas now!

Cheers,

Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061012/e5ddd91e/attachment.htm>


More information about the vtkusers mailing list