[vtkusers] Can't move vtkAxesActor with vtkInteractorStyleTrackballActor

David Doria daviddoria+vtk at gmail.com
Mon Jan 11 08:59:13 EST 2010


On Mon, Jan 11, 2010 at 6:34 AM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> The right way to modify the axes actor is to modify the camera. That's
> its purpose (to follow the camera).
> The trackball actor interactor style doesn't rotate the camera. It
> simply changes the transform associated with individual actors as you
> interact with them.
>
>
> On Sun, Jan 10, 2010 at 3:59 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>> If I use vtkInteractorStyleTrackballActor:
>>
>>  vtkSmartPointer<vtkInteractorStyleTrackballActor> style =
>>      vtkSmartPointer<vtkInteractorStyleTrackballActor>::New(); //like paraview
>>
>>  renderWindowInteractor->SetInteractorStyle( style );
>>
>> I can move/rotate a normal actor:
>>
>>  vtkSmartPointer<vtkConeSource> coneSource =
>> vtkSmartPointer<vtkConeSource>::New();
>>  vtkSmartPointer<vtkPolyDataMapper> coneMapper =
>> vtkSmartPointer<vtkPolyDataMapper>::New();
>>  coneMapper->SetInput(coneSource->GetOutput());
>>  vtkSmartPointer<vtkActor> coneActor = vtkSmartPointer<vtkActor>::New();
>>  coneActor->SetMapper(coneMapper);
>>  renderer->AddActor(coneActor);
>>
>> But I can't move/rotate an AxesActor:
>>
>> vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();
>> renderer->AddActor(axes);
>>
>> Anyone know why this might be?
>>
>> I tried setting:
>> axes->DragableOn();
>>
>> but it appears 'true' is the default value, so that didn't change anything.
>>
>> Thanks,
>>
>> David

Karthik,

Yes, that's what I was trying to do - change the transform of the axes
actor as I interact with it. I was trying to use it to represent
"positioning and aiming" a "camera" in my scene.

Is there a better tool to do this? Or is there a way to "unlock" the
axes actor so it will move with the trackballActor interactor?

Thanks,

David



More information about the vtkusers mailing list