Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mathutils.py « examples « doc « python « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b30a0f45058a25e27186789ee1d13a92d071727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import mathutils
from math import radians

vec = mathutils.Vector((1.0, 2.0, 3.0))

mat_rot = mathutils.Matrix.Rotation(radians(90), 4, 'X')
mat_trans = mathutils.Matrix.Translation(vec)

mat = mat_trans * mat_rot
mat.invert()

mat3 = mat.rotation_part()
quat1 = mat.to_quat()
quat2 = mat3.to_quat()

angle = quat1.difference(quat2)

print(angle)