Removing an axis of rotation

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.

Thanks

This code should help:

https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#rotate-a-node-around-a-specified-point

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.

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

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.