[vtkusers] SetUserMatrix ineffective on vtkAnnotatedCubeActor

Xiaofeng Z xf10036 at hotmail.com
Thu Aug 18 16:25:58 EDT 2011


Hi vtkusers,


I'm trying to use SetUserMatrix() to change the orientation of a vtkAnnotatedCubeActor, but the function seemed to be ineffective.  Why?

My renderering pipeline as the following:


    vtkAnnotatedCubeActor* actor = vtkAnnotatedCubeActor::New();
    vtkMatrix4x4* matrix = vtkMatrix4x4::New();
    static double elem[16] = {
         0, 0,-1, 0,
        -1, 0, 0, 0,
         0, 1, 0, 0,
         0, 0, 0, 1 };
    matrix->DeepCopy(elem);
    actor->SetUserMatrix(matrix);
    matrix->Delete();
  vtkRenderer *ren = vtkRenderer::New();
  ren->SetViewport(0.0, 0.0, 1.0, 1.0);
        ren->SetBackground(0.1, 0.2, 0.3);
        ren->AddActor(prop);
        prop->Delete();

  vtkRenderWindow* win = vtkRenderWindow::New();
        win->LineSmoothingOn();
        win->PolygonSmoothingOn();
  win->SetSize(300,300);
  win->AddRenderer(ren);
        ren->Delete();

  interactor = vtkRenderWindowInteractor::New();
  interactor->SetRenderWindow(win);
        win->Delete();

        win->Render();

Thanks for any insight!


Xiaofeng 		 	   		  


More information about the vtkusers mailing list