# vtkRenderWindowInteractor3D is not work with exit cod 0 and render window just flash and disappear!!!

**URL:** https://discourse.vtk.org/t/vtkrenderwindowinteractor3d-is-not-work-with-exit-cod-0-and-render-window-just-flash-and-disappear/8976
**Category:** Support
**Created:** [July 20, 2022, 7:03am UTC](https://discourse.vtk.org/t/vtkrenderwindowinteractor3d-is-not-work-with-exit-cod-0-and-render-window-just-flash-and-disappear/8976 "2022-07-20T07:03:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![heruiyuan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/heruiyuan/32/3770_2.png) [@heruiyuan](https://discourse.vtk.org/u/heruiyuan)
#### Post date: [July 20, 2022, 7:03am UTC](https://discourse.vtk.org/t/vtkrenderwindowinteractor3d-is-not-work-with-exit-cod-0-and-render-window-just-flash-and-disappear/8976/1 "2022-07-20T07:03:05Z")

</div>

vtkNew colors;  
vtkNew Source;  
Source-\>SetXLength(5);  
Source-\>SetYLength(5);  
Source-\>SetZLength(5);  
Source-\>Update();

// Create a mapper and actor  
vtkNew mapper;  
mapper-\>SetInputConnection(Source-\>GetOutputPort());

vtkNew actor;  
actor-\>SetMapper(mapper);  
actor-\>GetProperty()-\>SetColor(colors-\>GetColor3d(“Tomato”).GetData());  
// Create a renderer, render window, and interactor  
vtkNew renderer;  
vtkNew renderWindow;  
renderWindow-\>SetMultiSamples(0); // Turn off anti-aliasing  
renderWindow-\>AddRenderer(renderer);  
vtkNew 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;

---

<div class="post-metadata">

### Author: ![501586528](https://discourse.vtk.org/user_avatar/discourse.vtk.org/501586528/32/7907_2.png) [@501586528](https://discourse.vtk.org/u/501586528)
#### Post date: [October 30, 2023, 12:40pm UTC](https://discourse.vtk.org/t/vtkrenderwindowinteractor3d-is-not-work-with-exit-cod-0-and-render-window-just-flash-and-disappear/8976/2 "2023-10-30T12:40:25Z")

</div>

Hello, if you solve it?
