How can i implement an interactive coordinate axis to move/rotate my actor

143fd55c4d6343c7a5d12b99ac1cc429
I am new to VTK. Now my project is going to render two actor. And I want to implement an interactive coordinate axis to move or rotate one of my actor, but i have no idea how to start my project. Is there any code sample for me to study?

That’s a very nice looking widget! It would be very nice to have in VTK.

Just a word of warning: implementing a widget in VTK is very hard. Especially for a new comer because so many parts of the system come together and have to be coordinated properly for the widget to behave correctly.

From a high-level, the widgets consist of two parts: a representation which is where the geometry/appearance is defined; and the widget where events are processed and then passed to the representation which changes its appearance/state in response.

I’d suggest looking at the widget/representation pair vtkBoxWidget2 and vtkBoxRepresentation (in VTK/Interaction/Widgets). Then find the tests / examples that use this widget / representation pair and study them. There are many other widgets in Interaction/Widgets that you can study as well.

Good luck!

2 Likes

Hey musheng - Did you end up getting this working?