# Rotation around specific point

**URL:** https://discourse.slicer.org/t/rotation-around-specific-point/9398
**Category:** Support
**Tags:** transforms
**Created:** [December 5, 2019, 1:54pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398 "2019-12-05T13:54:30Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Jmarcs](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jmarcs](https://discourse.slicer.org/u/Jmarcs)
#### Post date: [December 5, 2019, 1:54pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/1 "2019-12-05T13:54:30Z")

</div>

Is it possible to change the center of rotation of an object in Transform when i move it

---

<div class="post-metadata">

### Author: ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)
#### Post date: [December 5, 2019, 2:26pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/2 "2019-12-05T14:26:16Z")

</div>

In theory, you may do a translation by moving the center of object to the origin, do the rotation; then do a reverse-translation by moving back the object.

I am trying to do something on transform but I am also just hitting the road on this transform. I will follow this topic.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [December 5, 2019, 3:07pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/3 "2019-12-05T15:07:54Z")

</div>

I would not recommend to try to align objects using rotation around specified point, since landmark registration is much more reliable, faster, and accurate: you just specify a few corresponding points on the objects you want to align and you are done - no manual tuning of several sliders are necessary and result is guaranteed to be optimal. There are several landmark registration modules available in Slicer, but probably the most convenient and powerful is Fiducial registration wizard module in SlicerIGT extension.

Anyway, if you still want to do rotation around centerpoint (there are valid uses cases, they are just rare) then you can use this example in the script repository: [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Rotate\_a\_node\_around\_a\_specified\_point](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Rotate_a_node_around_a_specified_point)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [December 5, 2019, 6:25pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/5 "2019-12-05T18:25:16Z")

</div>

The bounding box of the transform interaction widget is set to the boundaries of all the transformed nodes. Therefor you can change the boundary by adding other transformable nodes under the same transform. However, since aligning objects in 3D view by interactive translation and rotation is extremely inefficient (it is an iterative process of translations, rotations, changing view orientation) I would not recommend doing this instead doing direct positioning by placing landmarks on the object you want to align.

---

<div class="post-metadata">

### Author: ![Jmarcs](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jmarcs](https://discourse.slicer.org/u/Jmarcs)
#### Post date: [December 5, 2019, 6:32pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/6 "2019-12-05T18:32:31Z")

</div>

I am agree with but my goal is not to align but to move a tooth like orthodontisc appliance with forces and center of rotation

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [December 5, 2019, 11:44pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/7 "2019-12-05T23:44:21Z")

</div>

> [@Jmarcs](#):
>
> my goal is not to align but to move a tooth like orthodontisc appliance with forces and center of rotation

For this, you can use the script that I referenced [above](https://discourse.slicer.org/t/rotation-around-specific-point/9398/3).

---

<div class="post-metadata">

### Author: ![alexk](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@alexk](https://discourse.slicer.org/u/alexk)
#### Post date: [December 8, 2019, 7:37pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/8 "2019-12-08T19:37:15Z")

</div>

Hello Mr. Lasso, I tested the codes to create a new center of rotation. I do not get the desired result.  
When I make the first linear transformation, my object does not turn around the new point.  
Can you tell me the correct coding in my case? Here is the [model](https://my.pcloud.com/publink/show?code=XZcm7bkZmsCKtP2i8hRWAeAOh1QyTHqdbPny) that I’m studying.  
Cordially

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [December 8, 2019, 8:03pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/9 "2019-12-08T20:03:21Z")

</div>

Pay attention to which transform you apply to the model and which one you are adjusting with sliders (they are not same).

Also check for any error messages in the console.

If you need more specific help, share a screen capture video of what you do, or save the scene as a bundle (mrb) file and share that.

---

<div class="post-metadata">

### Author: ![alexk](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@alexk](https://discourse.slicer.org/u/alexk)
#### Post date: [December 19, 2019, 9:36am UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/10 "2019-12-19T09:36:57Z")

</div>

Hello Mr. Lasso, my concern persists. I join [here](https://my.pcloud.com/publink/show?code=kZLgUhkZbYOJxUaqt8FGuLK3QpwWr5pecUl7) the model in vtk format and the scene.  
I want to rotate the model around himself and not about the axis of the skull base.  
Thank you for your help.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [December 19, 2019, 5:27pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/11 "2019-12-19T17:27:34Z")

</div>

I’ve just tried the [script](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#rotate-a-node-around-a-specified-point) that I posted earlier and it worked well. I’ve recorded it on a [video](https://1drv.ms/v/s!Arm_AFxB9yqHucN9pd6edw1a1cgxbg?e=x5SJOd) so that you can see all the steps.

---

<div class="post-metadata">

### Author: ![alexk](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@alexk](https://discourse.slicer.org/u/alexk)
#### Post date: [December 20, 2019, 10:06am UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/12 "2019-12-20T10:06:02Z")

</div>

Hello, thanks for the video.  
I don’t know why, but I have an error message :  
Traceback (most recent call last):  
File “”, line 1, in   
File “”, line 5, in updateFinalTransform  
AttributeError: ‘vtkSlicerMarkupsModuleMRMLPython.vtkMRMLMarkupsFid’ object has no attribute ‘GetNthControlPointPositionWorld’

I am attaching the [video to you.](https://my.pcloud.com/publink/show?code=XZkJrhkZY5lhdnsMSX8r7A0Cj8zEJ5uzLTiy)

cordially  
Alex

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [December 20, 2019, 1:52pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/13 "2019-12-20T13:52:57Z")

</div>

The script is for recent Slicer Preview Releases (currently 4.11.x). Method names are slightly different in latest Slicer Stable Release (currently 4.10.2).

---

<div class="post-metadata">

### Author: ![alexk](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@alexk](https://discourse.slicer.org/u/alexk)
#### Post date: [December 20, 2019, 8:55pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/14 "2019-12-20T20:55:12Z")

</div>

Perfect. Thanks a lot

---

<div class="post-metadata">

### Author: ![Mehran](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mehran/32/11080_2.png) [@Mehran](https://discourse.slicer.org/u/Mehran)
#### Post date: [July 14, 2023, 4:53pm UTC](https://discourse.slicer.org/t/rotation-around-specific-point/9398/15 "2023-07-14T16:53:50Z")

</div>

new link:  
[Transforms — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository/transforms.html#rotate-a-node-around-a-specified-point)
