[vtkusers] Question about mixing 2d and 3d actors again...
Anja Ende
anja.ende at googlemail.com
Wed Oct 11 06:33:21 EDT 2006
Hi everyone,
I was wondering if anyone has successfully displayed a 3d actor over a 2d
actor and be willing to share an example.
I tried but unsuccessfully... I am only either able to show the 3d actor
that is scaled and my 2d actor is not visible or I see nothing at all. I
tried setting camera stuff (especially with parallel projection) but did
not really work. I guess I am shooting in the dark here...
I am trying to do something simple like:
// Add our 2d actor
this->m_renderer->AddActor(this->m_actor2D);
vtkPNGReader * cursorImage = vtkPNGReader::New();
cursorImage->SetFileName("/home/anja/bin/crosshair.png");
cursorImage->Update();
vtkImageActor * actor = vtkImageActor::New();
actor->SetInput(cursorImage->GetOutput());
actor->PickableOn();
// Add the 3d actor.
this->m_renderer->AddActor(actor);
actor->Delete();
cursorImage->Delete();
// As per David's suggestion.
this->m_actor2D->GetProperty()->SetDisplayLocationToBackground();
this->m_renderer->GetActiveCamera()->ParallelProjectionOn();
Hope you can help me. Thanks again :)
I will keep trying and update this thread when this is solved. I think a lot
of newbies like me are struggling with this.
Cheers,
Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061011/0ca51d44/attachment.htm>
More information about the vtkusers
mailing list