[vtkusers] Re: Question about mixing 2d and 3d actors again...
Roger Blum
roger_blum at swissonline.ch
Wed Oct 11 16:50:45 EDT 2006
Hi Anja,
In my application I have geographic maps as background using the
vtkImageActor (3D). On top of these I display 2D and 3D polydata objects
created by vtkGlyph3D. The 2D symbols are mapped by a vtkPolyDataMapper2D. I
have managed to have the overlayed polydata objects fixed in size by
adjusting their size when changing camera position and/or view angle. To
achieve this I added an observer on AnyEvent to the camera.
I'm not sure if this situation is similar to what you are doing, but maybe
it gives you an idea to solve your problem.
Something else that was very helpful for my work is the VtkGUI tool
(http://vtkgui.cineca.it/), although it's not available for the latest vtk
release. It allows to experiment interactively with pipeline objects. This
is the way I found a lot of answers to my questions (and ideas that don't
work!), when nobody on this list could help. If you are on Linux, you can
try Vtk Designer (http://www.vcreatelogic.com/oss/vtkdesigner/index.html)
which works with Vtk 4.4.
Regards,
Roger
"Anja Ende" <anja.ende at googlemail.com> schrieb im Newsbeitrag
news:1f5d2b4f0610110553v2c45bba1gbe0079a349d288f7 at mail.gmail.com...
hmmmmmmmmm... also this SetTransformCoordinate seems only available with
vtkPolyDataMapper2D. Is there anything similar for the vtkImageMapper?
Confusing....! :D
Cheers,
Anja
On 11/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
Hi Roger,
Thanks for replying to my question.
I just wanted to clarify it with you. So you had 2d and 3d actors on the
same scene and you set the coordinate system of the 2D mapper to the world
coordinate system. Did I understand you correctly?
Cheers,
Anja
On 11/10/06, Anja Ende < anja.ende at googlemail.com> wrote:
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
--
Cheers,
Anja
--
Cheers,
Anja
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list