vtkRenderWindowInteractor3D is not work with exit cod 0 and render window just flash and disappear!!!
I test vtkRenderWindowInteractor3D with simple example and want to interact with a actor in a specific like vtkRenderWindowInteractor, but I want to use the methods of vtkRenderWindowInteractor3D. Here is my simple example code:
vtkNew<vtkNamedColors> colors;
vtkNew<vtkCubeSource> Source;
Source->SetXLength(5);
Source->SetYLength(5);
Source->SetZLength(5);
Source->Update();
// Create a mapper and actor
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(Source->GetOutputPort());
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
actor->GetProperty()->SetColor(colors->GetColor3d("Tomato").GetData());
// Create a renderer, render window, and interactor
vtkNew<vtkRenderer> renderer;
vtkNew<vtkRenderWindow> renderWindow;
renderWindow->SetMultiSamples(0); // Turn off anti-aliasing
renderWindow->AddRenderer(renderer);
vtkNew<vtkRenderWindowInteractor3D> renderWindowInteractor3D;
renderWindowInteractor3D->SetRenderWindow(renderWindow);
// Add the actor to the scene
renderer->AddActor(actor);
renderer->SetBackground(colors->GetColor3d("Mint").GetData());
// Render and interact
renderWindow->Render();
renderWindowInteractor3D->Initialize();
renderWindowInteractor3D->Start();
return EXIT_SUCCESS;
Edited by Rien