[vtkusers] Two vtkRenderer in one vtkRenderWindow
Tobias Erne
tme at thermoanalytics.com
Fri Jan 24 08:44:00 EST 2003
Hi,
I tried the small program on three different workstations.
They run all under Windows2000 and Linux RedHat 7.3 and on all the same
problem. With one vtkRenderer it works fine under Windows2000.
Any other suggestions?
-Tobi
> 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
More information about the vtkusers
mailing list