[vtkusers] Two vtkRenderer in one vtkRenderWindow
Budd Hirons
bhiron at lsuhsc.edu
Thu Jan 23 13:32:01 EST 2003
Hi Tobi,
well it isn't your code, I just ran it on win2k/vc6 and everything was fine.
perhaps it is your graphics environment on win2k ... graphics card/openGL
drivers?
Budd.
At 12:51 PM 1/23/2003 -0500, you wrote:
>Hello everybody,
>
>I'm trying to use two vtkRenderer in one vtkRenderWindow.
>I would like to have the second vtkRenderer in the upper left corner.
>My problem is, that everything works fine under Linux Red Hat 7.3 but under
>Windows 2000 I get only black screen.
>
>Can anyone help me?
>
>Thanks in advance.
>
>Here is my example code.
>
>void main( int argc, char *argv[] )
>{
> // create a rendering window and two renderer
> vtkRenderer *ren = vtkRenderer::New();
>
> vtkRenderer *ren1 = vtkRenderer::New();
> ren1->SetViewport( 0,0.8,0.2,1);
>
> vtkRenderWindow *renWindow = vtkRenderWindow::New();
> renWindow->AddRenderer(ren);
> renWindow->AddRenderer(ren1);
> renWindow->SetSize( 600, 600 );
>
> ren->SetBackground(1,1,1);
> ren1->SetBackground(0,0,0);
>
> // create an actor and give it cone geometry
> vtkCubeSource *cube = vtkCubeSource::New();
> cube->SetBounds(10.0,15.0,10.0,20.0,10.0,20.0);
> vtkPolyDataMapper *cubeMapper = vtkPolyDataMapper::New();
> cubeMapper->SetInput(cube->GetOutput());
> vtkActor *cubeActor = vtkActor::New();
> cubeActor->SetMapper(cubeMapper);
> cubeActor->RotateY(-20.0);
>
> vtkProperty *prop = vtkProperty::New();
> prop = cubeActor->GetProperty();
> prop->SetColor( 1,0,1);
>
> ren->AddActor(cubeActor);
>
> // Interaction
> vtkRenderWindowInteractor *inter = vtkRenderWindowInteractor::New();
> vtkInteractorStyleSwitch* joy = vtkInteractorStyleSwitch::New();
> inter->SetInteractorStyle(joy);
>
> inter->SetRenderWindow(renWindow);
> inter->Initialize();
>
> // draw the resulting scene
> renWindow->Render();
> inter->Start();
>
> // Clean up
> ren->Delete();
> renWindow->Delete();
> cube->Delete();
> cubeMapper->Delete();
> cubeActor->Delete();
> inter->Delete();
>}
>
>-Tobi
>
>-------------------------------------------------------
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list