# Gizmo or any other alternative to bbox widget to rotate a polydata

**URL:** https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132
**Category:** Support
**Created:** [February 3, 2021, 10:09am UTC](https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132 "2021-02-03T10:09:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [February 3, 2021, 10:09am UTC](https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132/1 "2021-02-03T10:09:00Z")

</div>

Hi everybody,

I wonder if there is any library for gizmo I can integrate with vtk for rendering.  
Any recommendation?. Or a similar widget for rotation to replace the  
bounding box widget where the rotation is very difficult to perform.

Thanks

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [February 16, 2021, 3:15pm UTC](https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132/2 "2021-02-16T15:15:41Z")

</div>

I implemented it by myself with the help of the mitk that is already implemented if someone is interested. It is quite easy to adapt it. I use an interactor style of vtk and the gizmo class for its structure. And the mathematics behind of gizmo are on google.

---

<div class="post-metadata">

### Author: ![mpb27](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mpb27/32/3030_2.png) [@mpb27](https://discourse.vtk.org/u/mpb27)
#### Post date: [February 18, 2021, 10:27pm UTC](https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132/3 "2021-02-18T22:27:32Z")

</div>

Any chance you’d be willing to share the code on GitHub?

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [February 19, 2021, 7:52am UTC](https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132/4 "2021-02-19T07:52:31Z")

</div>

It is already there.

> **[MITK/MITK](https://github.com/MITK/MITK)**
>
> master/Modules/Gizmo/src

veru easy to read and follow. My adaptation is not a widget either. It is based on interactor style and the structure as it is shown here.

Good luck

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [February 19, 2021, 12:58pm UTC](https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132/5 "2021-02-19T12:58:27Z")

</div>

I wonder if I had implemented the gizmo as a widget, the code would be more efficient. As I am switching from camera to gizmo style every time I click on an actor. Someone has any idea?. So if it is was a widget it would be independent from the style.

If i wanted to implement it as a widget, should I define representation and widget?. Or I can subclass it directly?. Any idea?

By now I will keep the interactor solution as it works although it might not be the best solution until I find an efficient way to make it widget then I can share the code in github.

Thanks

---

<div class="post-metadata">

### Author: ![DFlyer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dflyer/32/1598_2.png) [@DFlyer](https://discourse.vtk.org/u/DFlyer)
#### Post date: [November 23, 2023, 1:06pm UTC](https://discourse.vtk.org/t/gizmo-or-any-other-alternative-to-bbox-widget-to-rotate-a-polydata/5132/6 "2023-11-23T13:06:39Z")

</div>

Did you find am efficient way or implemented a Gizmo widget?  
Also using the Gizmo style makes it dependent on MITK, wondering if you attempted to create a standalone Gizmo.

Thanks!
