<div dir="ltr">Hi all,<br><br>I am trying to add a vtkOrientationMarkerWidget to a QVTKWidget. The annotatedCube is displayed in the corner but it doesn&#39;t rotate along with the other actors.<br><br>I checkd the code with vtkRenderWindow, it works well. What is the problem??<br>
<br>Below is the code<br><br><br><br>from vtk import*<br>cube=vtkCubeSource()<br>cube.SetXLength(200)<br>cube.SetYLength(200)<br>cube.SetZLength(200)<br>cube.Update()<br>cm=vtkPolyDataMapper()<br>cm.SetInputConnection(cube.GetOutputPort())<br>
ca=vtkActor()<br>ca.SetMapper(cm)<br><br>renWin = vtkRenderWindow()<br>ren=vtkRenderer()<br>ren.AddActor(ca)<br>renWin.AddRenderer(ren)<br>iren = vtkRenderWindowInteractor()<br>iren.SetRenderWindow(renWin)<br>ren.SetBackground(0,0,0)<br>
renWin.Render()<br><br>axesActor = vtkAnnotatedCubeActor();<br>axesActor.SetXPlusFaceText(&#39;R&#39;)<br>axesActor.SetXMinusFaceText(&#39;L&#39;)<br>axesActor.SetYMinusFaceText(&#39;H&#39;)<br>axesActor.SetYPlusFaceText(&#39;F&#39;)<br>
axesActor.SetZMinusFaceText(&#39;P&#39;)<br>axesActor.SetZPlusFaceText(&#39;A&#39;)<br>axesActor.GetTextEdgesProperty().SetColor(1,1,0)<br>axesActor.GetTextEdgesProperty().SetLineWidth(2)<br>axesActor.GetCubeProperty().SetColor(0,0,1)<br>
axes = vtkOrientationMarkerWidget();<br>axes.SetOrientationMarker(axesActor);<br>axes.SetInteractor(iren);<br>axes.EnabledOn();<br>axes.InteractiveOn();<br><br><br>Thanks,<br><br>Jothy<br><br><br><br><br><br></div>