# Removing an axis of rotation

**URL:** <https://discourse.slicer.org/t/removing-an-axis-of-rotation/25876>\
**Category:** Support\
**Created:** [October 24, 2022, 9:18pm UTC](https://discourse.slicer.org/t/removing-an-axis-of-rotation/25876 "2022-10-24T21:18:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aamir\_Khan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aamir_khan/32/8627_2.png) [@Aamir\_Khan](https://discourse.slicer.org/u/Aamir_Khan)\
**Post date:** [October 24, 2022, 9:18pm UTC](https://discourse.slicer.org/t/removing-an-axis-of-rotation/25876/1 "2022-10-24T21:18:23Z")

</div>

Hi,

I have been trying develop a module where by:

1. Specify the center of sphere (done)
2. Specify the radius of sphere (done)
3. USing dynamic modeler to specify the thickness of the sphere (done)
4. Using dynamic modeler to cut the sphere into half using a markup plane (done)
5. Now the generated hemisphere is to be rotated about the center.

I am able to create a widget whereby I can rotate the hemisphere about the three axes. But I want to remove the option for rotating about its axis (i.e. the IS axis). How could I do this?

I am attaching the link for the code.

> **[RotateSphere/RotateSphere at main · AMK-TUM/RotateSphere](https://github.com/AMK-TUM/RotateSphere/tree/main/RotateSphere)**
>
> main/RotateSphere

Thanks

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 24, 2022, 10:05pm UTC](https://discourse.slicer.org/t/removing-an-axis-of-rotation/25876/2 "2022-10-24T22:05:36Z")

</div>

This code should help:

[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#rotate-a-node-around-a-specified-point](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#rotate-a-node-around-a-specified-point)

---

<div class="post-metadata">

**Author:** ![Aamir\_Khan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aamir_khan/32/8627_2.png) [@Aamir\_Khan](https://discourse.slicer.org/u/Aamir_Khan)\
**Post date:** [October 25, 2022, 9:05pm UTC](https://discourse.slicer.org/t/removing-an-axis-of-rotation/25876/3 "2022-10-25T21:05:58Z")

</div>

Thanks for the link. I have been struggling to restrict the option to rotate about just two axis and not three. I want to remove the rotation about the LR axis, i.e. remove the option to rotate the hemisphere about its axis.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 25, 2022, 10:17pm UTC](https://discourse.slicer.org/t/removing-an-axis-of-rotation/25876/4 "2022-10-25T22:17:40Z")

</div>

Ah, I see, did you see this example then?

[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#rotate-a-node-around-a-specified-line](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#rotate-a-node-around-a-specified-line)

You could also look at how some map-like interactor styles allow you to rotate around the globe while keeping north pointing north. This works in most the world but is undefined at the poles and gives some weird results. I don’t have a good code reference but basically you map x/y rotations to changes in latitude/longitude and then always set the up vector to north projected onto the cross product of the tangents at that point.
