Message 1 of 1
Python rotation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a problem with object rotation using python code.
In my system objcests are rotated in system -1 to 1 xyz, e.q (1,0,0) means straight to the right (x axis). I know how to convert it to the quat or euler but when I'm tring to rotate object using python everethis seems to by a random. Could you help me?
This is my code:
def RotateNodes(self):
for n in self.allNodes():
pos = n.GetName().split(",")
pos = map(int, pos)
#print(pos)
cords = self.ovffile.array[pos[0],pos[1],pos[2],:] #Rotation in (-1 | 0 | 1)xyz system
#print(cords)
quat = (qt.vec_to_quat(self,np.array([0,0,1]),np.array(cords))) #Rotation in Quat (0 | 1)xyzw
n.Rotate=MaxPlus.Quat(*quat)
Could you help me what I'm doing wrong?