How to switch transform from global to local


(Timeanddoctor) #1

How to switch transform from global to local with python script. Are there any example codes?
By the way, where can I found the setting of the transform attribute in python code?


How to change translation from global to Local with python code?
(Timeanddoctor) #2

I can create a transform and set translation on local manually. But are there any code could change translation from global to Local with python code?
I checked github code found: setCoordinateReference(LOCAL), while a error happen as follows:
‘vTransformr.setCoordinateReference(LOCAL)
Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘vtkCommonTransformsPython.vtkTransform’ object has no attribute 'setCoordinateReference’


(Andras Lasso) #3

Local/global means if translation is performed before or after the rotation. You can achieve this by decomposing transformation into a translation and rotation part and changing up their order.