728x90
Camera 의 viewport 에 따라서 움직이는 3D text 를 만든다.
vtkAxes axes = vtkAxes.New();
axes.SetOrigin(0, 0, 0);
vtkPolyDataMapper axesMapper = vtkPolyDataMapper.New();
axesMapper.SetInputConnection(axes.GetOutputPort());
vtkActor axesActor = vtkActor.New();
axesActor.SetMapper(axesMapper);
ren1.AddActor(axesActor);
vtkVectorText atext = vtkVectorText.New();
atext.SetText("Origin");
vtkPolyDataMapper textMapper = vtkPolyDataMapper.New();
textMapper.SetInputConnection(atext.GetOutputPort());
vtkFollower textActor = vtkFollower.New();
textActor.SetMapper(textMapper);
textActor.SetScale(0.2, 0.2, 0.2);
textActor.AddPosition(0, -0.1, 0);
textActor.GetProperty().SetColor(colors.GetColor3d("Silver").GetCppThis().Handle);
textActor.SetCamera(ren1.GetActiveCamera());
ren1.AddActor(textActor);
728x90
728x90