[vtkusers] Please help! vtkActor::Render( )

scsrsao at leeds.ac.uk scsrsao at leeds.ac.uk
Fri Aug 11 05:13:40 EDT 2006


Hi Louis,

 I'm no an expert at all, but what I have done when I want to add or remove
actors from a scene is simply that, use the add and remove methods from the
renderer and render the scene again... somthing like this

lets assume i have two actors a renderer and a render window

initially you could do something like
ren->AddActor(actor1);
ren->AddActor(actor2);
renwin->AddRenderer(ren);
renwin->Render();

now, if you want the image without the first actor, just do
ren->RemoveActor(ren1);
renwin->Render();

if you want it again in the image, just add it again
ren->AddActor(actor1);
renwin->Render();

etc...
hope it helps,
Rodolfo

> ------------------------------
>
> Message: 2
> Date: Wed, 09 Aug 2006 17:23:11 +0000
> From: "Louis Desjardins" <lost_bits1110 at hotmail.com>
> Subject: [vtkusers] Please help!  vtkActor::Render( )
> To: vtkusers at vtk.org
> Message-ID: <BAY119-F102418BF608B657CFD719999550 at phx.gbl>
> Content-Type: text/plain; format=flowed
>
> Hi VTK Experts,
>
> I had put a post regarding this before but didnt get any response, I was
> probably unclear in my question.
>
> I was just wondering if anyone has tried using the function
> vtkActor::Render( Renderer *, Mapper *) to render actors in a scene? I need
> to use some OpenGL and GLUT commands and I need to be able to render the vtk
> actor's at a particular time/state.
>
> The standard way of adding actors to a renderer, renderer to a renderwindow,
> causes the actors to be rendered whenever VTK wants. However I need more
> control over when the actors are rendered. Hence I need to be able to use
> this function.
> I did something like this in my code:
>
> // Ren1 contains no actors
> RenWin->AddRenderer( Ren1 );
> RenWin->Render();
> Actor->Render();
>
> This however just causes a blank screen to be rendered. What am I doing
> wrong? Or is it just not possible to have more immediate control over when
> the actor's are rendered...?
>
> If anyone can give me any suggestions this would really help a lot!!! BTW I
> also tried adding a RenderWindow::Frame() command after calling
> RenderWindow::Render(). This however resulted in a strange looking image..
>
> Thanks again in advance for your help!!!!
> LD
>
> _________________________________________________________________
> Don?t just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
>
> ------------------------------




More information about the vtkusers mailing list