[vtkusers] vtkRenderer dosen't focused on (0, 0, 0) after beening added to renderWindow

louiskoo 419655660 at qq.com
Tue Jun 25 21:25:55 EDT 2013


This is my C# code: 
vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow;

            vtkRenderer renderer =
renderWindow.GetRenderers().GetFirstRenderer();
            //renderer.SetActiveCamera(camera1);
            renderer.SetBackground(0.2, 0.3, 0.4);
            renderer.AddActor(actor0);
            renderer.SetLayer(0);
            renderer.InteractiveOff();
            //vtkCamera rendCamera = renderer.GetActiveCamera();
            //Console.WriteLine(rendCamera.GetPosition()[0] + ": " +
rendCamera.GetPosition()[1] + "; " + rendCamera.GetPosition()[2]);
            //renderer1.AddActor(actor2);

            vtkRenderer lung = vtkRenderer.New();
            lung.SetLayer(1);
            lung.AddActor(actor1);
            lung.SetActiveCamera(camera1);  

            vtkRenderer topRenderer = vtkRenderer.New();
            topRenderer.SetLayer(2);
            //topRenderer.InteractiveOff();
            topRenderer.AddActor(actor2);
            topRenderer.SetActiveCamera(lung.GetActiveCamera());

            renderWindow.SetNumberOfLayers(2);
            renderWindow.AddRenderer(lung);

            vtkInteractorStyle style = vtkInteractorStyle.New();
           
            vtkRenderWindowInteractor interactor =
renderWindow.GetInteractor();
            interactor.SetInteractorStyle(style);
            interactor.Initialize();
            //renderWindow.AddRenderer(topRenderer);
            renderWindow.Render();

Any one can tell me why the lung(vtkRenderer) dose not focus on (0,0,0) when
rotating?



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkRenderer-dosen-t-focused-on-0-0-0-after-beening-added-to-renderWindow-tp5721611.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list