TextActor in multi viewport

I’m coding for a multi viewport framework,(2*2), want to add a short text message in each viewport using vtkTextActor, but find the SetDisplayPosition is based on the RendererWindow coordinate, which means the position of the text keep the same postion whenever I change the size of the rendererwindow. Is it possible to make the text always located on relative coordinats for each viewport,?


Hi, friend,

Try setting position with SetPosition2() instead. The coordinate system is relative to a viewport: https://vtk.org/doc/nightly/html/classvtkActor2D.html#a287e2aac3f96c71680fe4682d897c036 . The docs say it is in normalized coordinates, that is, between 0.0 (0%) and 1.0 (100%) of viewport size.

I hope this helps,