[vtkusers] Rotation with vtkProp3D (Set/GetOrientation)

Aurélie Larcher Aurelie.Larcher at imag.fr
Tue Feb 24 11:33:56 EST 2009


Hello,
I don't understand why, when I orientate the Y axes of an actor with the 
function setOrientation(0,90,0), my actor doesn't rotate.
It's exactly the same representation if I set the orientation to (0,0,0) 
or (0,45,0) or another y-value.
Is anybody can explain me ?
Here a piece of code and the 3D object.
*****
   vtkPolyDataReader *outils = vtkPolyDataReader::New();
        outils->SetFileName( "C:/Images/vtk/outils.vtk" );   
    vtkPolyDataMapper *outilsMapper = vtkPolyDataMapper::New();
        outilsMapper->SetInput(outils->GetOutput());
        outilsMapper->ScalarVisibilityOff();
    vtkActor *outilRouge = vtkActor::New();
        outilRouge->SetMapper(outilsMapper);
        outilRouge->GetProperty()->SetDiffuseColor(1, .49, .25);
        outilRouge->GetProperty()->SetSpecular(0);
        outilRouge->GetProperty()->SetSpecularPower(20);
        outilRouge->GetProperty()->SetColor( 1.0, 0, 0 );
        outilRouge->GetProperty()->SetOpacity( 1 );
        outilRouge->SetOrigin(0,0,0);
        outilRouge->SetPosition(0,0,0);
        outilRouge->SetOrientation(0,90,0);        // or (0,0,0) or 
(0,10,0) or (0,45,0)...
    vtkRenderer *rendu3D2 = vtkRenderer::New();
    vtkRenderWindow *fenetre = vtkRenderWindow::New();
    vtkRenderWindowInteractor *interactor = 
vtkRenderWindowInteractor::New();
    rendu3D2->AddActor(outilRouge);
    rendu3D2->SetBackground(0,0,0);
    rendu3D2->ResetCamera();
    rendu3D2->GetActiveCamera()->Elevation(90);
    fenetre->AddRenderer(rendu3D2);
    fenetre->SetSize(600,600);
    interactor->SetRenderWindow(fenetre);      
    fenetre->Render();
    interactor->Initialize();
    interactor->Start();   
*****

For the curious, I have an other problem certainly linked in my 
understanding problem :
- The object (actor) is positioned and rotated according to his center. 
I can obtain this coordinates (x,y,z).
- I know the distance between the center and the extremity.
- The origine is set to (0,0,0)
- Any orientation could be performed in x-y and z axes, I have this 
angles with the function GetOrientation()
==> I would like to know WHERE is the coordinates (x',y',z') of the 
extremity of my actor.
... It seems nevertheless simple ...
Thanks for your help !
Aurélie

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: outils.vtk
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090224/9a689d15/attachment.txt>


More information about the vtkusers mailing list