How to create a fixed 2D vtkActor on the top of the 3D vtkActors

Hi all,

I’m trying to put a 2D vtkActor on the display coordinate, no matter how other 3D vtkActors’ camera moved, this 2D vtkActor should be in a fixed position in the scene. Currently, this 2D vtkActor is a 2D plane with 3D points. The 3D vtkActors and 2D vtkActor share the same texture info and both use self-defined vtkOpenGLPolyDataMapper for texture rendering.
I know I can create two different vtkRenderer and set camera and viewport properties separately to reach the results I want. But in our case, we are wondering if the two renderers share the same OpenGL context or if we have to upload the same data twice.
Or if it’s possible to use vtkActor2D and vtkOpenGLPolyDataMapper2D do the same magic.
Any idea about which way is better? Many thanks in advance :smile:

In earlier VTK versions it was not trivial to share textures between renderers (see for example how it was implemented in CustusX), but in current VTK versions this might be simpler.

Hi, Thank you ao much for the reply. I’ll take a look and see if this works for our case.